From 6ae2d0d53d5b52433f39328b5cedd09a81f9841c Mon Sep 17 00:00:00 2001 From: yzy Date: Thu, 14 Mar 2024 15:15:07 +0800 Subject: [PATCH] update --- doc/nacos/config/dev/blade-dev.yaml | 51 +- doc/nacos/config/prod/blade-prod.yaml | 27 +- doc/nacos/config/test/blade-test.yaml | 25 + doc/nginx/dev/nginx.conf | 10 +- doc/nginx/test/nginx.conf | 2 +- doc/sql/clean-flow-business.sql | 2 +- pom.xml | 14 +- security-service-api/ht-security-api/pom.xml | 27 + .../security/ht/entity/basic/Department.java | 256 +++++++ .../org/security/ht/entity/basic/Device.java | 267 +++++++ .../security/ht/entity/basic/Employee.java | 218 ++++++ .../org/security/ht/entity/basic/Family.java | 162 +++++ .../security/ht/entity/basic/JobRecord.java | 144 ++++ .../org/security/ht/entity/basic/Law.java | 97 +++ .../security/ht/entity/basic/MailList.java | 133 ++++ .../ht/entity/basic/SelfHelpBank.java | 138 ++++ .../security/ht/entity/common/BaseEntity.java | 58 ++ .../org/security/ht/entity/common/File.java | 94 +++ .../security/ht/entity/common/FlowEntity.java | 35 + .../java/org/security/ht/feign/IHtClient.java | 64 ++ .../security/ht/feign/IHtClientFallback.java | 39 + .../feign/basic/DepartmentClientFallback.java | 28 + .../feign/basic/EmployeeClientFallback.java | 30 + .../ht/feign/basic/IDepartmentClient.java | 48 ++ .../ht/feign/basic/IEmployeeClient.java | 45 ++ .../security/ht/vo/basic/DepartmentVO.java | 78 ++ .../org/security/ht/vo/basic/DeptDataVO.java | 28 + .../org/security/ht/vo/basic/DeviceVO.java | 45 ++ .../org/security/ht/vo/basic/EmployeeVO.java | 78 ++ .../org/security/ht/vo/basic/FamilyVO.java | 36 + .../org/security/ht/vo/basic/JobRecordVO.java | 36 + .../java/org/security/ht/vo/basic/LawVO.java | 43 ++ .../org/security/ht/vo/basic/MailListVO.java | 36 + .../security/ht/vo/basic/MapDeptDataVO.java | 38 + .../org/security/ht/vo/basic/RoleDataVO.java | 13 + .../security/ht/vo/basic/SelfHelpBankVO.java | 37 + .../org/security/ht/vo/common/FileVO.java | 36 + .../org/security/ht/vo/common/UploadVO.java | 55 ++ .../dto/HandoverHistoryDTO.java | 19 + .../dto/WorkHandoverUsersDTO.java | 12 + .../entity/HandoverHistory.java | 58 ++ .../entity/WorkHandoverUsers.java | 66 ++ .../vo/HandoverHistoryVO.java | 23 + .../vo/WorkHandoverCheckVO.java | 27 + .../vo/WorkHandoverUsersVO.java | 17 + .../ht/workHandOverUsers/vo/deptDataVO.java | 18 + security-service-api/pom.xml | 2 +- security-service/ht-security/pom.xml | 124 ++++ .../main/java/org/security/Application.java | 19 + .../java/org/security/common/Constant.java | 196 ++++++ .../common/business/BusinessController.java | 39 + .../common/config/AppOauth2Propertis.java | 20 + .../common/config/CommonProperties.java | 22 + .../common/config/FeignConfiguration.java | 13 + .../config/ScheduledTaskProperties.java | 64 ++ .../common/config/ThreadPoolConfig.java | 26 + .../common/eum/AssessmentYearEnum.java | 65 ++ .../security/common/eum/EducationEnum.java | 84 +++ .../security/common/eum/FrequencyEnum.java | 60 ++ .../security/common/eum/OtherDataEnum.java | 63 ++ .../security/common/eum/ProjectNodeEnum.java | 69 ++ .../common/eum/TaskBusinessTypeEnum.java | 92 +++ .../security/common/eum/TaskHandInEnum.java | 38 + .../eum/evaluationTimeIntervalEnum.java | 81 +++ .../security/common/exception/ErrorCode.java | 59 ++ .../common/exception/ExceptionUtils.java | 53 ++ .../common/exception/RenException.java | 49 ++ .../common/exception/RenExceptionHandler.java | 46 ++ .../handler/CustomCellWriteHandler.java | 101 +++ .../handler/SecurityMetaObjectHandler.java | 34 + .../security/common/util/DataFormatUtil.java | 27 + .../security/common/util/DeadlineUtil.java | 122 ++++ .../common/util/DocumentNumberUtil.java | 21 + .../org/security/common/util/ExcelUtil.java | 146 ++++ .../common/util/MyCellStyleStrategyUtil.java | 65 ++ .../org/security/common/util/QrCodeUtil.java | 67 ++ .../security/common/util/TaskCehckUtil.java | 45 ++ .../org/security/common/util/XssUtils.java | 65 ++ .../common/validator/ValidatorUtils.java | 37 + .../common/validator/group/AddGroup.java | 19 + .../common/validator/group/DefaultGroup.java | 19 + .../common/validator/group/Group.java | 22 + .../common/validator/group/UpdateGroup.java | 19 + .../trans/app/controller/AppController.java | 117 +++ .../trans/app/dto/AppDeviceCheckDTO.java | 31 + .../security/trans/app/dto/AppDeviceDTO.java | 39 + .../security/trans/app/dto/TaskHandInDTO.java | 24 + .../security/trans/app/mapper/AppMapper.java | 8 + .../trans/app/service/IAppDeviceService.java | 63 ++ .../trans/app/service/IAppEducateService.java | 31 + .../trans/app/service/IAppService.java | 21 + .../service/impl/AppDeviceServiceImpl.java | 321 +++++++++ .../service/impl/AppEducateServiceImpl.java | 71 ++ .../app/service/impl/AppServiceImpl.java | 194 +++++ .../trans/app/vo/AppDeviceCheckItemVO.java | 43 ++ .../security/trans/app/vo/AppDeviceVO.java | 88 +++ .../org/security/trans/app/vo/BacklogVO.java | 68 ++ .../security/trans/app/vo/TaskHandInVO.java | 34 + .../controller/DutyRecordsController.java | 129 ++++ .../DutyRecordsLinesController.java | 126 ++++ .../controller/NoteRemindController.java | 136 ++++ .../controller/WorkFilingController.java | 117 +++ .../WorkOvertimeReportingController.java | 115 +++ .../WorkOvertimeReportingLinesController.java | 126 ++++ .../applyAndReport/dto/DutyRecordsDTO.java | 40 ++ .../dto/DutyRecordsLinesDTO.java | 34 + .../applyAndReport/dto/NoteRemindDTO.java | 34 + .../applyAndReport/dto/WorkFilingDTO.java | 43 ++ .../dto/WorkOvertimeReportingDTO.java | 38 + .../dto/WorkOvertimeReportingLinesDTO.java | 34 + .../applyAndReport/entity/DutyRecords.java | 141 ++++ .../entity/DutyRecordsLines.java | 81 +++ .../applyAndReport/entity/NoteRemind.java | 131 ++++ .../applyAndReport/entity/WorkFiling.java | 126 ++++ .../entity/WorkOvertimeReporting.java | 117 +++ .../entity/WorkOvertimeReportingLines.java | 80 +++ .../mapper/DutyRecordsLinesMapper.java | 42 ++ .../mapper/DutyRecordsLinesMapper.xml | 24 + .../mapper/DutyRecordsMapper.java | 42 ++ .../mapper/DutyRecordsMapper.xml | 35 + .../mapper/NoteRemindMapper.java | 48 ++ .../mapper/NoteRemindMapper.xml | 37 + .../mapper/WorkFilingMapper.java | 52 ++ .../mapper/WorkFilingMapper.xml | 42 ++ .../WorkOvertimeReportingLinesMapper.java | 42 ++ .../WorkOvertimeReportingLinesMapper.xml | 23 + .../mapper/WorkOvertimeReportingMapper.java | 42 ++ .../mapper/WorkOvertimeReportingMapper.xml | 29 + .../service/IDutyRecordsLinesService.java | 41 ++ .../service/IDutyRecordsService.java | 76 ++ .../service/INoteRemindService.java | 70 ++ .../service/IWorkFilingService.java | 55 ++ .../IWorkOvertimeReportingLinesService.java | 41 ++ .../IWorkOvertimeReportingService.java | 49 ++ .../impl/DutyRecordsLinesServiceImpl.java | 41 ++ .../service/impl/DutyRecordsServiceImpl.java | 232 ++++++ .../service/impl/NoteRemindServiceImpl.java | 128 ++++ .../service/impl/WorkFilingServiceImpl.java | 134 ++++ ...WorkOvertimeReportingLinesServiceImpl.java | 41 ++ .../WorkOvertimeReportingServiceImpl.java | 122 ++++ .../applyAndReport/vo/DutyRecordsLinesVO.java | 36 + .../applyAndReport/vo/DutyRecordsVO.java | 59 ++ .../applyAndReport/vo/ExportRecordsVO.java | 109 +++ .../trans/applyAndReport/vo/NoteRemindVO.java | 55 ++ .../trans/applyAndReport/vo/WorkFilingVO.java | 49 ++ .../vo/WorkOvertimeReportingLinesVO.java | 36 + .../vo/WorkOvertimeReportingVO.java | 40 ++ .../controller/AssessmentController.java | 114 +++ .../trans/assessment/dto/AssessmentDTO.java | 44 ++ .../assessment/dto/AssessmentDetailDTO.java | 34 + .../trans/assessment/entity/Assessment.java | 241 +++++++ .../assessment/entity/AssessmentDetail.java | 119 ++++ .../mapper/AssessmentDetailMapper.java | 31 + .../mapper/AssessmentDetailMapper.xml | 22 + .../assessment/mapper/AssessmentMapper.java | 46 ++ .../assessment/mapper/AssessmentMapper.xml | 102 +++ .../service/IAssessmentDetailService.java | 37 + .../service/IAssessmentService.java | 78 ++ .../impl/AssessmentDetailServiceImpl.java | 61 ++ .../service/impl/AssessmentServiceImpl.java | 285 ++++++++ .../assessment/vo/AssessmentDetailVO.java | 33 + .../trans/assessment/vo/AssessmentVO.java | 77 ++ .../controller/DepartmentController.java | 231 ++++++ .../basic/controller/DeviceController.java | 164 +++++ .../basic/controller/EmployeeController.java | 151 ++++ .../basic/controller/FamilyController.java | 126 ++++ .../basic/controller/JobRecordController.java | 126 ++++ .../trans/basic/controller/LawController.java | 129 ++++ .../basic/controller/MailListController.java | 126 ++++ .../controller/SelfHelpBankController.java | 119 ++++ .../trans/basic/dto/DepartmentDTO.java | 46 ++ .../security/trans/basic/dto/DeviceDTO.java | 47 ++ .../trans/basic/dto/DeviceExcelDTO.java | 73 ++ .../security/trans/basic/dto/EmployeeDTO.java | 91 +++ .../trans/basic/dto/EmployeeDataCountDTO.java | 15 + .../security/trans/basic/dto/FamilyDTO.java | 34 + .../trans/basic/dto/JobRecordDTO.java | 34 + .../org/security/trans/basic/dto/LawDTO.java | 40 ++ .../security/trans/basic/dto/MailListDTO.java | 34 + .../trans/basic/dto/SelfHelpBankDTO.java | 34 + .../trans/basic/fegin/DepartmentClient.java | 44 ++ .../trans/basic/fegin/EmployeeClient.java | 41 ++ .../trans/basic/mapper/DepartmentMapper.java | 76 ++ .../trans/basic/mapper/DepartmentMapper.xml | 140 ++++ .../trans/basic/mapper/DeviceMapper.java | 66 ++ .../trans/basic/mapper/DeviceMapper.xml | 88 +++ .../trans/basic/mapper/EmployeeMapper.java | 69 ++ .../trans/basic/mapper/EmployeeMapper.xml | 44 ++ .../trans/basic/mapper/FamilyMapper.java | 42 ++ .../trans/basic/mapper/FamilyMapper.xml | 33 + .../trans/basic/mapper/JobRecordMapper.java | 42 ++ .../trans/basic/mapper/JobRecordMapper.xml | 30 + .../trans/basic/mapper/LawMapper.java | 46 ++ .../security/trans/basic/mapper/LawMapper.xml | 19 + .../trans/basic/mapper/MailListMapper.java | 42 ++ .../trans/basic/mapper/MailListMapper.xml | 29 + .../basic/mapper/SelfHelpBankMapper.java | 42 ++ .../trans/basic/mapper/SelfHelpBankMapper.xml | 28 + .../basic/service/IDepartmentService.java | 133 ++++ .../trans/basic/service/IDeviceService.java | 106 +++ .../trans/basic/service/IEmployeeService.java | 82 +++ .../trans/basic/service/IFamilyService.java | 41 ++ .../basic/service/IJobRecordService.java | 41 ++ .../trans/basic/service/ILawService.java | 51 ++ .../trans/basic/service/IMailListService.java | 41 ++ .../basic/service/ISelfHelpBankService.java | 43 ++ .../service/impl/DepartmentServiceImpl.java | 268 +++++++ .../basic/service/impl/DeviceServiceImpl.java | 429 +++++++++++ .../service/impl/EmployeeServiceImpl.java | 429 +++++++++++ .../basic/service/impl/FamilyServiceImpl.java | 41 ++ .../service/impl/JobRecordServiceImpl.java | 41 ++ .../basic/service/impl/LawServiceImpl.java | 117 +++ .../service/impl/MailListServiceImpl.java | 41 ++ .../service/impl/SelfHelpBankServiceImpl.java | 78 ++ .../controller/ExcelExportController.java | 35 + .../common/controller/FileController.java | 84 +++ .../common/controller/Oauth2Controller.java | 36 + .../common/controller/UploadController.java | 60 ++ .../trans/common/dto/AccessTokenDTO.java | 13 + .../security/trans/common/dto/AuthResult.java | 14 + .../security/trans/common/dto/BaseObject.java | 33 + .../trans/common/dto/ExcelExportDTO.java | 24 + .../trans/common/dto/ExcelExportFieldDTO.java | 36 + .../security/trans/common/dto/FileDTO.java | 34 + .../trans/common/dto/UserDetailDTO.java | 23 + .../common/mapper/ExcelExportMapper.java | 18 + .../trans/common/mapper/ExcelExportMapper.xml | 18 + .../trans/common/mapper/FileMapper.java | 53 ++ .../trans/common/mapper/FileMapper.xml | 35 + .../common/service/ExcelExportService.java | 21 + .../trans/common/service/FlowableService.java | 111 +++ .../trans/common/service/IFileService.java | 95 +++ .../trans/common/service/Oauth2Service.java | 13 + .../trans/common/service/UploadService.java | 29 + .../service/impl/ExcelExportServiceImpl.java | 262 +++++++ .../impl/ExcelExportServiceImplTest.java | 79 +++ .../common/service/impl/FileServiceImpl.java | 247 +++++++ .../service/impl/Oauth2ServiceImpl.java | 139 ++++ .../service/impl/UploadServiceImpl.java | 71 ++ .../DeviceInspectionController.java | 152 ++++ .../DeviceInspectionLineController.java | 139 ++++ .../controller/InspectionController.java | 132 ++++ .../controller/InspectionLineController.java | 152 ++++ .../dailyDuties/dto/DeviceInspectionDTO.java | 58 ++ .../dto/DeviceInspectionLineDTO.java | 40 ++ .../trans/dailyDuties/dto/InspectionDTO.java | 50 ++ .../dailyDuties/dto/InspectionLineDTO.java | 49 ++ .../dto/InspectionLineExcelDTO.java | 92 +++ .../dailyDuties/entity/DeviceInspection.java | 174 +++++ .../entity/DeviceInspectionLine.java | 149 ++++ .../trans/dailyDuties/entity/Inspection.java | 203 ++++++ .../dailyDuties/entity/InspectionLine.java | 207 ++++++ .../mapper/DeviceInspectionLineMapper.java | 66 ++ .../mapper/DeviceInspectionLineMapper.xml | 66 ++ .../mapper/DeviceInspectionMapper.java | 69 ++ .../mapper/DeviceInspectionMapper.xml | 76 ++ .../mapper/InspectionLineMapper.java | 80 +++ .../mapper/InspectionLineMapper.xml | 101 +++ .../dailyDuties/mapper/InspectionMapper.java | 77 ++ .../dailyDuties/mapper/InspectionMapper.xml | 138 ++++ .../service/IDeviceInspectionLineService.java | 73 ++ .../service/IDeviceInspectionService.java | 78 ++ .../service/IInspectionLineService.java | 87 +++ .../service/IInspectionService.java | 116 +++ .../impl/DeviceInspectionLineServiceImpl.java | 180 +++++ .../impl/DeviceInspectionServiceImpl.java | 412 +++++++++++ .../impl/InspectionLineServiceImpl.java | 312 ++++++++ .../service/impl/InspectionServiceImpl.java | 388 ++++++++++ .../vo/DeviceInspectionLineVO.java | 50 ++ .../dailyDuties/vo/DeviceInspectionVO.java | 63 ++ .../trans/dailyDuties/vo/DevicePictureVO.java | 25 + .../dailyDuties/vo/InspectionLinePage.java | 29 + .../dailyDuties/vo/InspectionLineVO.java | 70 ++ .../trans/dailyDuties/vo/InspectionVO.java | 104 +++ .../controller/AnswerAlarmDataController.java | 42 ++ .../controller/AssessmentDataController.java | 40 ++ .../controller/DeviceDataController.java | 47 ++ .../DeviceInspectionDataController.java | 41 ++ .../controller/EduAndDrillDataController.java | 41 ++ .../controller/EmployeeDataController.java | 110 +++ .../controller/InspectionDataController.java | 36 + .../controller/MaterialDataController.java | 41 ++ .../controller/OutEmployeeDataController.java | 73 ++ .../controller/ProjectDataController.java | 73 ++ .../RectificationNoticeController.java | 41 ++ .../controller/RiskDataController.java | 41 ++ .../UnlocaleCheckDataController.java | 40 ++ .../dto/AnswerAlarmDataDTO.java | 19 + .../dataStatistics/dto/AssessmentDataDTO.java | 28 + .../dataStatistics/dto/DeviceDataDTO.java | 11 + .../dto/DeviceInspectionDataDTO.java | 19 + .../dto/EduAndDrillDataDTO.java | 24 + .../dataStatistics/dto/InspectionDataDTO.java | 19 + .../dataStatistics/dto/MaterialDataDTO.java | 19 + .../dataStatistics/dto/StatisticsDataDTO.java | 49 ++ .../dto/UnlocaleCheckDataDTO.java | 19 + .../dataStatistics/entity/DeviceData.java | 49 ++ .../service/AnswerAlarmDataService.java | 13 + .../service/AssessmentDataService.java | 21 + .../service/DeviceDataService.java | 19 + .../service/DeviceInspectionDataService.java | 13 + .../service/EduAndDrillDataService.java | 14 + .../service/IEmployeeDataService.java | 65 ++ .../service/InspectionDataService.java | 21 + .../service/MaterialDataService.java | 20 + .../service/OutEmployeeDataService.java | 21 + .../service/ProjectDataService.java | 45 ++ .../service/RectificationNoticeService.java | 13 + .../service/RiskDataService.java | 19 + .../service/UnlocaleCheckDataService.java | 20 + .../impl/AnswerAlarmDataServiceImpl.java | 109 +++ .../impl/AssessmentDataServiceImpl.java | 138 ++++ .../service/impl/DeviceDataServiceImpl.java | 110 +++ .../impl/DeviceInspectionDataServiceImpl.java | 125 ++++ .../impl/EduAndDrillDataServiceImpl.java | 106 +++ .../service/impl/EmployeeDataServiceImpl.java | 251 +++++++ .../impl/InspectionDataServiceImpl.java | 151 ++++ .../service/impl/MaterialDataServiceImpl.java | 93 +++ .../impl/OutEmployeeDataServiceImpl.java | 161 +++++ .../service/impl/ProjectDataServiceImpl.java | 209 ++++++ .../impl/RectificationNoticeServiceImpl.java | 135 ++++ .../service/impl/RiskDataServiceImpl.java | 92 +++ .../impl/UnlocaleCheckDataServiceImpl.java | 124 ++++ .../util/CalculationRatioUtil.java | 55 ++ .../dataStatistics/vo/AnswerAlarmDataVO.java | 42 ++ .../dataStatistics/vo/AssessmentDataVO.java | 41 ++ .../vo/DeviceInspectionDataVO.java | 55 ++ .../dataStatistics/vo/EduAndDrillDataVO.java | 32 + .../dataStatistics/vo/HistogramDataVO.java | 24 + .../dataStatistics/vo/InspectionDataVO.java | 57 ++ .../dataStatistics/vo/MaterialDataVO.java | 25 + .../dataStatistics/vo/PieChartDataVO.java | 25 + .../vo/RectificationNoticeDataVO.java | 55 ++ .../vo/RisingSunChartDeviceVo.java | 18 + .../dataStatistics/vo/RisingSunChartVO.java | 22 + .../trans/dataStatistics/vo/RiskDataVO.java | 21 + .../dataStatistics/vo/StatisticsDataVO.java | 53 ++ .../vo/UnlocaleCheckDataVO.java | 34 + .../org/security/trans/feign/HtClient.java | 79 +++ .../security/trans/feign/UserFeignClient.java | 29 + .../flow/controller/FlowDataController.java | 126 ++++ .../controller/FlowHistoryController.java | 85 +++ .../flow/controller/FlowNodeController.java | 126 ++++ .../security/trans/flow/dto/FlowDataDTO.java | 34 + .../trans/flow/dto/FlowHistoryDTO.java | 34 + .../security/trans/flow/dto/FlowNodeDTO.java | 34 + .../security/trans/flow/dto/FlowStartDTO.java | 45 ++ .../security/trans/flow/entity/FlowData.java | 68 ++ .../trans/flow/entity/FlowHistory.java | 141 ++++ .../security/trans/flow/entity/FlowNode.java | 86 +++ .../trans/flow/mapper/FlowDataMapper.java | 49 ++ .../trans/flow/mapper/FlowDataMapper.xml | 31 + .../trans/flow/mapper/FlowHistoryMapper.java | 52 ++ .../trans/flow/mapper/FlowHistoryMapper.xml | 38 + .../trans/flow/mapper/FlowNodeMapper.java | 42 ++ .../trans/flow/mapper/FlowNodeMapper.xml | 25 + .../trans/flow/service/IFlowDataService.java | 49 ++ .../flow/service/IFlowHistoryService.java | 86 +++ .../trans/flow/service/IFlowNodeService.java | 41 ++ .../service/impl/FlowDataServiceImpl.java | 48 ++ .../service/impl/FlowHistoryServiceImpl.java | 330 +++++++++ .../service/impl/FlowNodeServiceImpl.java | 41 ++ .../security/trans/flow/vo/FlowDataVO.java | 36 + .../security/trans/flow/vo/FlowHistoryVO.java | 36 + .../trans/flow/vo/FlowNodeDataVO.java | 36 + .../security/trans/flow/vo/FlowNodeVO.java | 36 + .../org/security/trans/outsourcing/README.md | 1 + .../controller/OutCompanyController.java | 133 ++++ .../controller/OutEmployeeController.java | 127 ++++ .../OutEmployeeFamilyController.java | 114 +++ .../OutEmployeeJobRecordController.java | 112 +++ .../trans/outsourcing/dto/OutCompanyDTO.java | 45 ++ .../trans/outsourcing/dto/OutEmployeeDTO.java | 67 ++ .../outsourcing/dto/OutEmployeeFamilyDTO.java | 34 + .../dto/OutEmployeeJobRecordDTO.java | 34 + .../trans/outsourcing/entity/OutCompany.java | 142 ++++ .../trans/outsourcing/entity/OutEmployee.java | 171 +++++ .../outsourcing/entity/OutEmployeeFamily.java | 91 +++ .../entity/OutEmployeeJobRecord.java | 73 ++ .../outsourcing/mapper/OutCompanyMapper.java | 65 ++ .../outsourcing/mapper/OutCompanyMapper.xml | 54 ++ .../mapper/OutEmployeeFamilyMapper.java | 43 ++ .../mapper/OutEmployeeFamilyMapper.xml | 26 + .../mapper/OutEmployeeJobRecordMapper.java | 43 ++ .../mapper/OutEmployeeJobRecordMapper.xml | 24 + .../outsourcing/mapper/OutEmployeeMapper.java | 59 ++ .../outsourcing/mapper/OutEmployeeMapper.xml | 60 ++ .../service/IOutCompanyService.java | 75 ++ .../service/IOutEmployeeFamilyService.java | 37 + .../service/IOutEmployeeJobRecordService.java | 37 + .../service/IOutEmployeeService.java | 84 +++ .../service/impl/OutCompanyServiceImpl.java | 164 +++++ .../impl/OutEmployeeFamilyServiceImpl.java | 59 ++ .../impl/OutEmployeeJobRecordServiceImpl.java | 57 ++ .../service/impl/OutEmployeeServiceImpl.java | 167 +++++ .../trans/outsourcing/vo/OutCompanyVO.java | 55 ++ .../outsourcing/vo/OutEmployeeFamilyVO.java | 82 +++ .../vo/OutEmployeeJobRecordVO.java | 69 ++ .../trans/outsourcing/vo/OutEmployeeVO.java | 70 ++ .../controller/PreventMaterialController.java | 87 +++ .../controller/PreventRiskController.java | 87 +++ .../trans/prevent/dto/PreventMaterialDTO.java | 30 + .../trans/prevent/dto/PreventRiskDTO.java | 21 + .../trans/prevent/entity/PreventMaterial.java | 142 ++++ .../trans/prevent/entity/PreventRisk.java | 84 +++ .../prevent/mapper/PreventMaterialMapper.java | 27 + .../prevent/mapper/PreventMaterialMapper.xml | 69 ++ .../prevent/mapper/PreventRiskMapper.java | 24 + .../prevent/mapper/PreventRiskMapper.xml | 52 ++ .../service/IPreventMaterialService.java | 58 ++ .../prevent/service/IPreventRiskService.java | 34 + .../impl/PreventMaterialServiceImpl.java | 165 +++++ .../service/impl/PreventRiskServiceImpl.java | 155 ++++ .../trans/prevent/vo/PreventMaterialVO.java | 60 ++ .../trans/prevent/vo/PreventRiskVO.java | 46 ++ .../controller/BudgetItemController.java | 106 +++ .../controller/ProjectCheckController.java | 60 ++ .../controller/ProjectContractController.java | 69 ++ .../controller/ProjectController.java | 162 +++++ .../ProjectEstablishmentController.java | 60 ++ .../ProjectImplementationController.java | 60 ++ .../ProjectOverHistoryController.java | 18 + .../controller/ProjectPayPlanController.java | 126 ++++ .../controller/ProjectPurchaseController.java | 61 ++ .../dto/BudgetItemDTO.java | 34 + .../dto/ProjectCheckDTO.java | 42 ++ .../dto/ProjectContractDTO.java | 58 ++ .../dto/ProjectDTO.java | 70 ++ .../dto/ProjectEstablishmentDTO.java | 61 ++ .../dto/ProjectImplementationDTO.java | 57 ++ .../dto/ProjectOverReviewDTO.java | 26 + .../dto/ProjectPayPlanDTO.java | 45 ++ .../dto/ProjectPurchaseDTO.java | 67 ++ .../entity/BudgetItem.java | 156 ++++ .../entity/Project.java | 140 ++++ .../entity/ProjectCheck.java | 79 +++ .../entity/ProjectContract.java | 152 ++++ .../entity/ProjectEstablishment.java | 105 +++ .../entity/ProjectImplementation.java | 99 +++ .../entity/ProjectOverHistory.java | 43 ++ .../entity/ProjectPayPlan.java | 117 +++ .../entity/ProjectPurchase.java | 118 ++++ .../mapper/BudgetItemMapper.java | 62 ++ .../mapper/BudgetItemMapper.xml | 75 ++ .../mapper/ProjectCheckMapper.java | 42 ++ .../mapper/ProjectCheckMapper.xml | 23 + .../mapper/ProjectContractMapper.java | 43 ++ .../mapper/ProjectContractMapper.xml | 30 + .../mapper/ProjectEstablishmentMapper.java | 42 ++ .../mapper/ProjectEstablishmentMapper.xml | 26 + .../mapper/ProjectImplementationMapper.java | 42 ++ .../mapper/ProjectImplementationMapper.xml | 24 + .../mapper/ProjectMapper.java | 73 ++ .../mapper/ProjectMapper.xml | 119 ++++ .../mapper/ProjectOverHistoryMapper.java | 11 + .../mapper/ProjectOverHistoryMapper.xml | 6 + .../mapper/ProjectPayPlanMapper.java | 42 ++ .../mapper/ProjectPayPlanMapper.xml | 29 + .../mapper/ProjectPurchaseMapper.java | 42 ++ .../mapper/ProjectPurchaseMapper.xml | 29 + .../service/IBudgetItemService.java | 73 ++ .../service/IProjectCheckService.java | 37 + .../service/IProjectContractService.java | 51 ++ .../service/IProjectEstablishmentService.java | 38 + .../IProjectImplementationService.java | 38 + .../service/IProjectOverHistoryService.java | 11 + .../service/IProjectPayPlanService.java | 41 ++ .../service/IProjectPurchaseService.java | 38 + .../service/IProjectService.java | 100 +++ .../service/impl/BudgetItemServiceImpl.java | 108 +++ .../service/impl/ProjectCheckServiceImpl.java | 57 ++ .../impl/ProjectContractServiceImpl.java | 76 ++ .../impl/ProjectEstablishmentServiceImpl.java | 62 ++ .../ProjectImplementationServiceImpl.java | 61 ++ .../impl/ProjectOverHistoryServiceImpl.java | 19 + .../impl/ProjectPayPlanServiceImpl.java | 41 ++ .../impl/ProjectPurchaseServiceImpl.java | 63 ++ .../service/impl/ProjectServiceImpl.java | 614 ++++++++++++++++ .../vo/BudgetItemVO.java | 60 ++ .../vo/DictDataVO.java | 61 ++ .../vo/ProjectCheckVO.java | 44 ++ .../vo/ProjectContractVO.java | 60 ++ .../vo/ProjectEstablishmentVO.java | 64 ++ .../vo/ProjectImplementationVO.java | 59 ++ .../vo/ProjectPayPlanVO.java | 46 ++ .../vo/ProjectPurchaseVO.java | 68 ++ .../projectBudgetManagement/vo/ProjectVO.java | 89 +++ .../vo/RemindDataVO.java | 30 + .../controller/PublicityController.java | 118 ++++ .../publicityReport/dto/PublicityDTO.java | 44 ++ .../publicityReport/entity/Publicity.java | 127 ++++ .../mapper/PublicityMapper.java | 43 ++ .../mapper/PublicityMapper.xml | 41 ++ .../service/IPublicityService.java | 64 ++ .../service/impl/PublicityServiceImpl.java | 108 +++ .../trans/publicityReport/vo/PublicityVO.java | 54 ++ .../controller/SccAlarmPushController.java | 107 +++ .../controller/SccAnswerAlarmController.java | 105 +++ .../controller/SccCheckController.java | 110 +++ .../controller/SccCheckLinesController.java | 82 +++ .../controller/SccMsgSendController.java | 126 ++++ .../SccUnlocaleCheckController.java | 143 ++++ .../SccUnlocaleCheckLineController.java | 126 ++++ .../dto/ContinuedRecDataDTO.java | 23 + .../dto/SccAlarmPushDTO.java | 53 ++ .../dto/SccAnswerAlarmDTO.java | 47 ++ .../dto/SccCheckDTO.java | 47 ++ .../dto/SccCheckLinesDTO.java | 70 ++ .../dto/SccMsgSendDTO.java | 34 + .../dto/SccUnlocaleCheckDTO.java | 63 ++ .../dto/SccUnlocaleCheckLineDTO.java | 47 ++ .../entity/SccAlarmPush.java | 140 ++++ .../entity/SccAnswerAlarm.java | 169 +++++ .../entity/SccCheck.java | 94 +++ .../entity/SccCheckLines.java | 122 ++++ .../entity/SccMsgSend.java | 99 +++ .../entity/SccUnlocaleCheck.java | 153 ++++ .../entity/SccUnlocaleCheckLine.java | 166 +++++ .../mapper/SccAlarmPushMapper.java | 64 ++ .../mapper/SccAlarmPushMapper.xml | 64 ++ .../mapper/SccAnswerAlarmMapper.java | 56 ++ .../mapper/SccAnswerAlarmMapper.xml | 72 ++ .../mapper/SccCheckLinesMapper.java | 47 ++ .../mapper/SccCheckLinesMapper.xml | 30 + .../mapper/SccCheckMapper.java | 55 ++ .../mapper/SccCheckMapper.xml | 64 ++ .../mapper/SccMsgSendMapper.java | 42 ++ .../mapper/SccMsgSendMapper.xml | 27 + .../mapper/SccUnlocaleCheckLineMapper.java | 55 ++ .../mapper/SccUnlocaleCheckLineMapper.xml | 40 ++ .../mapper/SccUnlocaleCheckMapper.java | 83 +++ .../mapper/SccUnlocaleCheckMapper.xml | 109 +++ .../service/ISccAlarmPushService.java | 85 +++ .../service/ISccAnswerAlarmService.java | 84 +++ .../service/ISccCheckLinesService.java | 57 ++ .../service/ISccCheckService.java | 93 +++ .../service/ISccMsgSendService.java | 41 ++ .../service/ISccUnlocaleCheckLineService.java | 60 ++ .../service/ISccUnlocaleCheckService.java | 120 ++++ .../service/impl/SccAlarmPushServiceImpl.java | 323 +++++++++ .../impl/SccAnswerAlarmServiceImpl.java | 270 +++++++ .../impl/SccCheckLinesServiceImpl.java | 76 ++ .../service/impl/SccCheckServiceImpl.java | 248 +++++++ .../service/impl/SccMsgSendServiceImpl.java | 56 ++ .../impl/SccUnlocaleCheckLineServiceImpl.java | 170 +++++ .../impl/SccUnlocaleCheckServiceImpl.java | 547 ++++++++++++++ .../vo/ContinuedRecDataVO.java | 75 ++ .../vo/SccAlarmPushVO.java | 59 ++ .../vo/SccAnswerAlarmVO.java | 79 +++ .../vo/SccCheckLinesVO.java | 70 ++ .../securityCommandCenter/vo/SccCheckVO.java | 64 ++ .../vo/SccMsgSendVO.java | 41 ++ .../vo/SccUnlocaleCheckLineVO.java | 49 ++ .../vo/SccUnlocaleCheckVO.java | 75 ++ .../controller/BusinessTypeController.java | 133 ++++ .../DeviceCategorySettingsController.java | 165 +++++ .../DeviceInspectionSettingsController.java | 136 ++++ .../controller/FileTemplateController.java | 133 ++++ .../trans/settings/dto/BusinessTypeDTO.java | 34 + .../dto/DeviceCategorySettingsDTO.java | 39 + .../dto/DeviceInspectionSettingsDTO.java | 34 + .../trans/settings/dto/FileTemplateDTO.java | 43 ++ .../trans/settings/entity/BusinessType.java | 112 +++ .../entity/DeviceCategorySettings.java | 124 ++++ .../entity/DeviceInspectionSettings.java | 118 ++++ .../trans/settings/entity/FileTemplate.java | 111 +++ .../settings/mapper/BusinessTypeMapper.java | 42 ++ .../settings/mapper/BusinessTypeMapper.xml | 44 ++ .../mapper/DeviceCategorySettingsMapper.java | 79 +++ .../mapper/DeviceCategorySettingsMapper.xml | 116 +++ .../DeviceInspectionSettingsMapper.java | 42 ++ .../mapper/DeviceInspectionSettingsMapper.xml | 30 + .../settings/mapper/FileTemplateMapper.java | 43 ++ .../settings/mapper/FileTemplateMapper.xml | 28 + .../service/IBusinessTypeService.java | 53 ++ .../IDeviceCategorySettingsService.java | 96 +++ .../IDeviceInspectionSettingsService.java | 42 ++ .../service/IFileTemplateService.java | 59 ++ .../service/impl/BusinessTypeServiceImpl.java | 53 ++ .../DeviceCategorySettingsServiceImpl.java | 156 ++++ .../DeviceInspectionSettingsServiceImpl.java | 74 ++ .../service/impl/FileTemplateServiceImpl.java | 95 +++ .../trans/settings/vo/BusinessTypeVO.java | 36 + .../settings/vo/DeviceCategorySettingsVO.java | 83 +++ .../vo/DeviceInspectionSettingsVO.java | 38 + .../trans/settings/vo/FileTemplateVO.java | 51 ++ .../trans/settings/wrapper/DCWrapper.java | 42 ++ .../trans/task/controller/TaskController.java | 112 +++ .../task/controller/TaskHandinController.java | 167 +++++ .../org/security/trans/task/dto/TaskDTO.java | 41 ++ .../trans/task/dto/TaskHandinDTO.java | 41 ++ .../org/security/trans/task/entity/Task.java | 227 ++++++ .../trans/task/entity/TaskHandin.java | 174 +++++ .../security/trans/task/entity/TaskTodo.java | 103 +++ .../trans/task/mapper/TaskHandinMapper.java | 91 +++ .../trans/task/mapper/TaskHandinMapper.xml | 241 +++++++ .../trans/task/mapper/TaskMapper.java | 82 +++ .../security/trans/task/mapper/TaskMapper.xml | 91 +++ .../task/service/ITaskHandinService.java | 128 ++++ .../trans/task/service/ITaskService.java | 75 ++ .../service/impl/TaskHandinServiceImpl.java | 665 ++++++++++++++++++ .../task/service/impl/TaskServiceImpl.java | 180 +++++ .../security/trans/task/vo/TaskHandinVO.java | 77 ++ .../security/trans/task/vo/TaskTodoVO.java | 23 + .../org/security/trans/task/vo/TaskVO.java | 50 ++ .../trans/taskCheck/TaskCheckController.java | 86 +++ .../trans/taskCheck/busi/NoteRemindCheck.java | 50 ++ .../trans/taskCheck/device/DeviceCheck.java | 281 ++++++++ .../taskCheck/device/DeviceCheckTask.java | 31 + .../device/DeviceDeadlineCheckTask.java | 81 +++ .../trans/taskCheck/task/ITaskCheck.java | 21 + .../taskCheck/task/TaskCheckFactory.java | 39 + .../trans/taskCheck/task/TaskCheckTask.java | 92 +++ .../taskCheck/task/TaskDeadlineCheckTask.java | 164 +++++ .../task/dto/TaskHandinCheckDTO.java | 21 + .../taskCheck/task/impl/BaseTaskCheck.java | 190 +++++ .../taskCheck/task/impl/ByDayTaskCheck.java | 38 + .../task/impl/ByHalfYearTaskCheck.java | 40 ++ .../taskCheck/task/impl/ByMonthTaskCheck.java | 38 + .../task/impl/ByQuarterTaskCheck.java | 38 + .../taskCheck/task/impl/ByWeekTaskCheck.java | 39 + .../taskCheck/task/impl/ByYearTaskCheck.java | 38 + .../taskCheck/task/impl/UnknowTaskCheck.java | 24 + .../controller/HandoverHistoryController.java | 57 ++ .../WorkHandoverUsersController.java | 108 +++ .../mapper/HandoverHistoryMapper.java | 10 + .../mapper/HandoverHistoryMapper.xml | 6 + .../mapper/WorkHandoverUsersMapper.java | 17 + .../mapper/WorkHandoverUsersMapper.xml | 32 + .../service/HandoverHistoryService.java | 22 + .../service/IWorkHandoverUsers.java | 28 + .../impl/HandoverHistoryServiceImpl.java | 70 ++ .../impl/WorkHandoverUsersService.java | 173 +++++ .../src/main/resources/ESAPI.properties | 438 ++++++++++++ .../src/main/resources/application-dev.yml | 16 + .../src/main/resources/application-prod.yml | 15 + .../src/main/resources/application-test.yml | 16 + .../src/main/resources/application.yml | 3 + .../src/main/resources/log/logback-dev.xml | 100 +++ .../src/main/resources/log/logback-prod.xml | 100 +++ .../src/main/resources/log/logback-test.xml | 100 +++ .../src/main/resources/mybatis-config.xml | 12 + .../src/main/resources/validation.properties | 29 + security-service/pom.xml | 14 +- security-service/security-desk/pom.xml | 42 +- .../HtbPulsarConsumerController.java | 52 +- .../basicDataSync/entity/UserSyncHistory.java | 7 + .../mapper/DeptLevlSyncHistoryMapper.java | 8 + .../mapper/DeptLevlSyncHistoryMapper.xml | 6 + .../service/IDeptLevlSyncHistoryService.java | 4 +- .../impl/DeptLevlSyncHistoryServiceImpl.java | 581 ++++++++------- .../task/DeskScheduledTasks.java | 27 + .../security/common/DeskThreadPoolConfig.java | 26 + .../controller/DownloadFileController.java | 8 +- .../controller/UploadFileController.java | 15 +- .../imagePlateform/SunECMClient.java | 4 +- .../service/IUploadFileService.java | 8 +- .../service/impl/UploadFileServiceImpl.java | 53 +- .../src/main/resources/log/logback-dev.xml | 6 +- .../src/main/resources/log/logback-prod.xml | 6 +- .../src/main/resources/log/logback-test.xml | 6 +- 661 files changed, 49875 insertions(+), 381 deletions(-) create mode 100644 security-service-api/ht-security-api/pom.xml create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Department.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Device.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Employee.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Family.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/JobRecord.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Law.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/MailList.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/SelfHelpBank.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/BaseEntity.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/File.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/FlowEntity.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/feign/IHtClient.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/feign/IHtClientFallback.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/DepartmentClientFallback.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/EmployeeClientFallback.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/IDepartmentClient.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/IEmployeeClient.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DepartmentVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DeptDataVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DeviceVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/EmployeeVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/FamilyVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/JobRecordVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/LawVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/MailListVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/MapDeptDataVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/RoleDataVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/SelfHelpBankVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/common/FileVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/vo/common/UploadVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/dto/HandoverHistoryDTO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/dto/WorkHandoverUsersDTO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/entity/HandoverHistory.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/entity/WorkHandoverUsers.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/HandoverHistoryVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/WorkHandoverCheckVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/WorkHandoverUsersVO.java create mode 100644 security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/deptDataVO.java create mode 100644 security-service/ht-security/pom.xml create mode 100644 security-service/ht-security/src/main/java/org/security/Application.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/Constant.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/business/BusinessController.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/config/AppOauth2Propertis.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/config/CommonProperties.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/config/FeignConfiguration.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/config/ScheduledTaskProperties.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/config/ThreadPoolConfig.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/eum/AssessmentYearEnum.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/eum/EducationEnum.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/eum/FrequencyEnum.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/eum/OtherDataEnum.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/eum/ProjectNodeEnum.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/eum/TaskBusinessTypeEnum.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/eum/TaskHandInEnum.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/eum/evaluationTimeIntervalEnum.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/exception/ErrorCode.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/exception/ExceptionUtils.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/exception/RenException.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/exception/RenExceptionHandler.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/handler/CustomCellWriteHandler.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/handler/SecurityMetaObjectHandler.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/util/DataFormatUtil.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/util/DeadlineUtil.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/util/DocumentNumberUtil.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/util/ExcelUtil.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/util/MyCellStyleStrategyUtil.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/util/QrCodeUtil.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/util/TaskCehckUtil.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/util/XssUtils.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/validator/ValidatorUtils.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/validator/group/AddGroup.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/validator/group/DefaultGroup.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/validator/group/Group.java create mode 100644 security-service/ht-security/src/main/java/org/security/common/validator/group/UpdateGroup.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/controller/AppController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/dto/AppDeviceCheckDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/dto/AppDeviceDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/dto/TaskHandInDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/mapper/AppMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/service/IAppDeviceService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/service/IAppEducateService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/service/IAppService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppDeviceServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppEducateServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/vo/AppDeviceCheckItemVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/vo/AppDeviceVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/vo/BacklogVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/app/vo/TaskHandInVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/DutyRecordsController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/DutyRecordsLinesController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/NoteRemindController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkFilingController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkOvertimeReportingController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkOvertimeReportingLinesController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/DutyRecordsDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/DutyRecordsLinesDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/NoteRemindDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkFilingDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkOvertimeReportingDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkOvertimeReportingLinesDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/DutyRecords.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/DutyRecordsLines.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/NoteRemind.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkFiling.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkOvertimeReporting.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkOvertimeReportingLines.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsLinesMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsLinesMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/NoteRemindMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/NoteRemindMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkFilingMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkFilingMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingLinesMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingLinesMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IDutyRecordsLinesService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IDutyRecordsService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/INoteRemindService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkFilingService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkOvertimeReportingLinesService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkOvertimeReportingService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/DutyRecordsLinesServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/DutyRecordsServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/NoteRemindServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkFilingServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkOvertimeReportingLinesServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkOvertimeReportingServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/DutyRecordsLinesVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/DutyRecordsVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/ExportRecordsVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/NoteRemindVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkFilingVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkOvertimeReportingLinesVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkOvertimeReportingVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/controller/AssessmentController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/dto/AssessmentDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/dto/AssessmentDetailDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/entity/Assessment.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/entity/AssessmentDetail.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentDetailMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentDetailMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/service/IAssessmentDetailService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/service/IAssessmentService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/service/impl/AssessmentDetailServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/service/impl/AssessmentServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/vo/AssessmentDetailVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/assessment/vo/AssessmentVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/controller/DepartmentController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/controller/DeviceController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/controller/EmployeeController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/controller/FamilyController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/controller/JobRecordController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/controller/LawController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/controller/MailListController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/controller/SelfHelpBankController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/DepartmentDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/DeviceDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/DeviceExcelDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/EmployeeDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/EmployeeDataCountDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/FamilyDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/JobRecordDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/LawDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/MailListDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/dto/SelfHelpBankDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/fegin/DepartmentClient.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/fegin/EmployeeClient.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DepartmentMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DepartmentMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DeviceMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DeviceMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/EmployeeMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/EmployeeMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/FamilyMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/FamilyMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/JobRecordMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/JobRecordMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/LawMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/LawMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/MailListMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/MailListMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/SelfHelpBankMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/mapper/SelfHelpBankMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/IDepartmentService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/IDeviceService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/IEmployeeService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/IFamilyService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/IJobRecordService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/ILawService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/IMailListService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/ISelfHelpBankService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/DepartmentServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/DeviceServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/EmployeeServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/FamilyServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/JobRecordServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/LawServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/MailListServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/SelfHelpBankServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/controller/ExcelExportController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/controller/FileController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/controller/Oauth2Controller.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/controller/UploadController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/dto/AccessTokenDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/dto/AuthResult.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/dto/BaseObject.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/dto/ExcelExportDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/dto/ExcelExportFieldDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/dto/FileDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/dto/UserDetailDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/mapper/ExcelExportMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/mapper/ExcelExportMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/mapper/FileMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/mapper/FileMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/ExcelExportService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/FlowableService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/IFileService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/Oauth2Service.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/UploadService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/impl/ExcelExportServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/impl/ExcelExportServiceImplTest.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/impl/FileServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/impl/Oauth2ServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/common/service/impl/UploadServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/DeviceInspectionController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/DeviceInspectionLineController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/InspectionController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/InspectionLineController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/DeviceInspectionDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/DeviceInspectionLineDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionLineDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionLineExcelDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/DeviceInspection.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/DeviceInspectionLine.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/Inspection.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/InspectionLine.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionLineMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionLineMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionLineMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionLineMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IDeviceInspectionLineService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IDeviceInspectionService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IInspectionLineService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IInspectionService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/DeviceInspectionLineServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/DeviceInspectionServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/InspectionLineServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/InspectionServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DeviceInspectionLineVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DeviceInspectionVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DevicePictureVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionLinePage.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionLineVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/AnswerAlarmDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/AssessmentDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/DeviceDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/DeviceInspectionDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/EduAndDrillDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/EmployeeDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/InspectionDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/MaterialDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/OutEmployeeDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/ProjectDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/RectificationNoticeController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/RiskDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/UnlocaleCheckDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/AnswerAlarmDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/AssessmentDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/DeviceDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/DeviceInspectionDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/EduAndDrillDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/InspectionDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/MaterialDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/StatisticsDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/UnlocaleCheckDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/entity/DeviceData.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/AnswerAlarmDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/AssessmentDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/DeviceDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/DeviceInspectionDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/EduAndDrillDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/IEmployeeDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/InspectionDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/MaterialDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/OutEmployeeDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/ProjectDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/RectificationNoticeService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/RiskDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/UnlocaleCheckDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/AnswerAlarmDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/AssessmentDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/DeviceDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/DeviceInspectionDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/EduAndDrillDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/EmployeeDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/InspectionDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/MaterialDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/OutEmployeeDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/ProjectDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/RectificationNoticeServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/RiskDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/UnlocaleCheckDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/util/CalculationRatioUtil.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/AnswerAlarmDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/AssessmentDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/DeviceInspectionDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/EduAndDrillDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/HistogramDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/InspectionDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/MaterialDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/PieChartDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RectificationNoticeDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RisingSunChartDeviceVo.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RisingSunChartVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RiskDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/StatisticsDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/UnlocaleCheckDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/feign/HtClient.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/feign/UserFeignClient.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowDataController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowHistoryController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowNodeController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowHistoryDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowNodeDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowStartDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowData.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowHistory.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowNode.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowDataMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowDataMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowHistoryMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowHistoryMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowNodeMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowNodeMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowDataService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowHistoryService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowNodeService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowDataServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowHistoryServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowNodeServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowHistoryVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowNodeDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowNodeVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/README.md create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutCompanyController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeFamilyController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeJobRecordController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutCompanyDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeFamilyDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeJobRecordDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutCompany.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployee.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployeeFamily.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployeeJobRecord.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutCompanyMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutCompanyMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeFamilyMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeFamilyMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeJobRecordMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeJobRecordMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutCompanyService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeFamilyService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeJobRecordService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutCompanyServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeFamilyServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeJobRecordServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutCompanyVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeFamilyVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeJobRecordVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/controller/PreventMaterialController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/controller/PreventRiskController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/dto/PreventMaterialDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/dto/PreventRiskDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/entity/PreventMaterial.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/entity/PreventRisk.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventMaterialMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventMaterialMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventRiskMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventRiskMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/service/IPreventMaterialService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/service/IPreventRiskService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/service/impl/PreventMaterialServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/service/impl/PreventRiskServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/vo/PreventMaterialVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/prevent/vo/PreventRiskVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/BudgetItemController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectCheckController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectContractController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectEstablishmentController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectImplementationController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectOverHistoryController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectPayPlanController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectPurchaseController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/BudgetItemDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectCheckDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectContractDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectEstablishmentDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectImplementationDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectOverReviewDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectPayPlanDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectPurchaseDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/BudgetItem.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/Project.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectContract.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectEstablishment.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectImplementation.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectOverHistory.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectPayPlan.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectPurchase.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/BudgetItemMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/BudgetItemMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectCheckMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectCheckMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectContractMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectContractMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectEstablishmentMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectEstablishmentMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectImplementationMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectImplementationMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectOverHistoryMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectOverHistoryMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPayPlanMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPayPlanMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPurchaseMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPurchaseMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IBudgetItemService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectCheckService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectContractService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectEstablishmentService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectImplementationService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectOverHistoryService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectPayPlanService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectPurchaseService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/BudgetItemServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectCheckServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectContractServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectEstablishmentServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectImplementationServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectOverHistoryServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectPayPlanServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectPurchaseServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/BudgetItemVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/DictDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectCheckVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectContractVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectEstablishmentVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectImplementationVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectPayPlanVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectPurchaseVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/RemindDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/publicityReport/controller/PublicityController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/publicityReport/dto/PublicityDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/publicityReport/entity/Publicity.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/publicityReport/mapper/PublicityMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/publicityReport/mapper/PublicityMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/publicityReport/service/IPublicityService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/publicityReport/service/impl/PublicityServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/publicityReport/vo/PublicityVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccAlarmPushController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccAnswerAlarmController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccCheckController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccCheckLinesController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccMsgSendController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccUnlocaleCheckController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccUnlocaleCheckLineController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/ContinuedRecDataDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccAlarmPushDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccAnswerAlarmDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccCheckDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccCheckLinesDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccMsgSendDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccUnlocaleCheckDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccUnlocaleCheckLineDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccAlarmPush.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccAnswerAlarm.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccCheckLines.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccMsgSend.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccUnlocaleCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccUnlocaleCheckLine.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAlarmPushMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAlarmPushMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAnswerAlarmMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAnswerAlarmMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckLinesMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckLinesMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccMsgSendMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccMsgSendMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckLineMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckLineMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccAlarmPushService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccAnswerAlarmService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccCheckLinesService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccCheckService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccMsgSendService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccUnlocaleCheckLineService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccUnlocaleCheckService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccAlarmPushServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccAnswerAlarmServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccCheckLinesServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccCheckServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccMsgSendServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccUnlocaleCheckLineServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccUnlocaleCheckServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/ContinuedRecDataVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccAlarmPushVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccAnswerAlarmVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccCheckLinesVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccCheckVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccMsgSendVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccUnlocaleCheckLineVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccUnlocaleCheckVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/controller/BusinessTypeController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/controller/DeviceCategorySettingsController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/controller/DeviceInspectionSettingsController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/controller/FileTemplateController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/dto/BusinessTypeDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/dto/DeviceCategorySettingsDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/dto/DeviceInspectionSettingsDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/dto/FileTemplateDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/entity/BusinessType.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/entity/DeviceCategorySettings.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/entity/DeviceInspectionSettings.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/entity/FileTemplate.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/mapper/BusinessTypeMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/mapper/BusinessTypeMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceCategorySettingsMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceCategorySettingsMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceInspectionSettingsMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceInspectionSettingsMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/mapper/FileTemplateMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/mapper/FileTemplateMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/service/IBusinessTypeService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/service/IDeviceCategorySettingsService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/service/IDeviceInspectionSettingsService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/service/IFileTemplateService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/BusinessTypeServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/DeviceCategorySettingsServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/DeviceInspectionSettingsServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/FileTemplateServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/vo/BusinessTypeVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/vo/DeviceCategorySettingsVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/vo/DeviceInspectionSettingsVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/vo/FileTemplateVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/settings/wrapper/DCWrapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/controller/TaskController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/controller/TaskHandinController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/dto/TaskDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/dto/TaskHandinDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/entity/Task.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/entity/TaskHandin.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/entity/TaskTodo.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskHandinMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskHandinMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/service/ITaskHandinService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/service/ITaskService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/service/impl/TaskHandinServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/service/impl/TaskServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskHandinVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskTodoVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskVO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/TaskCheckController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/busi/NoteRemindCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceCheckTask.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceDeadlineCheckTask.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/ITaskCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskCheckFactory.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskCheckTask.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskDeadlineCheckTask.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/dto/TaskHandinCheckDTO.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/BaseTaskCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByDayTaskCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByHalfYearTaskCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByMonthTaskCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByQuarterTaskCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByWeekTaskCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByYearTaskCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/UnknowTaskCheck.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/controller/HandoverHistoryController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/controller/WorkHandoverUsersController.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/HandoverHistoryMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/HandoverHistoryMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/WorkHandoverUsersMapper.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/WorkHandoverUsersMapper.xml create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/HandoverHistoryService.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/IWorkHandoverUsers.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/impl/HandoverHistoryServiceImpl.java create mode 100644 security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/impl/WorkHandoverUsersService.java create mode 100644 security-service/ht-security/src/main/resources/ESAPI.properties create mode 100644 security-service/ht-security/src/main/resources/application-dev.yml create mode 100644 security-service/ht-security/src/main/resources/application-prod.yml create mode 100644 security-service/ht-security/src/main/resources/application-test.yml create mode 100644 security-service/ht-security/src/main/resources/application.yml create mode 100644 security-service/ht-security/src/main/resources/log/logback-dev.xml create mode 100644 security-service/ht-security/src/main/resources/log/logback-prod.xml create mode 100644 security-service/ht-security/src/main/resources/log/logback-test.xml create mode 100644 security-service/ht-security/src/main/resources/mybatis-config.xml create mode 100644 security-service/ht-security/src/main/resources/validation.properties create mode 100644 security-service/security-desk/src/main/java/org/security/basicDataSync/task/DeskScheduledTasks.java create mode 100644 security-service/security-desk/src/main/java/org/security/common/DeskThreadPoolConfig.java diff --git a/doc/nacos/config/dev/blade-dev.yaml b/doc/nacos/config/dev/blade-dev.yaml index 794bba1..9aab008 100644 --- a/doc/nacos/config/dev/blade-dev.yaml +++ b/doc/nacos/config/dev/blade-dev.yaml @@ -2,10 +2,10 @@ spring: redis: ##redis 单机环境配置 - host: http://127.0.0.1/ - port: 6379 + host: 197.52.29.131 + port: 16379 timeout: 10000 - password: P@ssw0rd_redis + password: database: 0 ssl: false ##redis 集群环境配置 @@ -13,12 +13,12 @@ spring: # nodes: 47.108.70.243:7001,47.108.70.243:7002,47.108.70.243:7003 # commandTimeout: 5000 datasource: - driver-class-name: com.mysql.cj.jdbc.Driver + driver-class-name: com.alipay.oceanbase.jdbc.Driver druid: validation-query: select 1 - url: jdbc:mysql://36.147.33.60:13306/security?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true - username: root - password: P@ssw0rd_mysql + url: jdbc:oceanbase://oceanbase.test.htb.srv:2883/sisdev?useUnicode=true&characterEncoding=utf-8&mode=mysql&rewriteBatchedStatements=true&socketTimeout=6000000&connectTimeout=60000&allowMultiQueries=true&useLocalSessionState=true + username: htb_test_obcluster:secretiy:secretiydev + password: secretiydev #项目模块集中配置 blade: @@ -32,7 +32,7 @@ blade: ribbon: rule: #开启配置 - enabled: false + enabled: true #负载均衡优先调用的ip段 prior-ip-pattern: - 192.168.0.* @@ -40,9 +40,9 @@ blade: #通用开发生产环境数据库地址(特殊情况可在对应的子工程里配置覆盖) datasource: dev: - url: jdbc:mysql://36.147.33.60:13306/security?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true - username: root - password: P@ssw0rd_mysql + url: jdbc:oceanbase://oceanbase.test.htb.srv:2883/sisdev?useUnicode=true&characterEncoding=utf-8&mode=mysql&rewriteBatchedStatements=true&socketTimeout=6000000&connectTimeout=60000&allowMultiQueries=true&useLocalSessionState=true + username: htb_test_obcluster:secretiy:secretiydev + password: secretiydev # # Emb(消息总线请求参数)配置 -sit @@ -100,11 +100,11 @@ single: chnl-tp: 41022 -#secutity-yml配置文件 +#ht-secutity-yml配置文件 #导出文件的存储路径 export: excel: - path: D:\安全管理信息化平台\excel导出测试\ + path: D:\云南红塔银行安保项目\excel导出测试\ #swagger包扫描路径 swagger: @@ -117,3 +117,28 @@ common: payPlanRemindKeyName: payPlanRemindDay #付款计划提醒提前天数字典配置键值 concatDeadlineRemindKeyName: concatDeadlineRemindDay #合同到期提醒提前天数字典配置键值 service_path: /home/test/apps/file/ # 服务器存放文件路径-用于附件删除 + +#定时任务参数配置 +schedule: + #【定时任务】自动生成设备检查任务 + deviceInspectionCron: 0 0 1 * * ? + #【定时任务】设备类型变更关联设备检查对应字段变更 + deviceCatgChangeCron: 0 0 3 * * ? + #【定时任务】设备检查是否超时 + deviceInspOvertimeCron: 0 1 0 * * ? + #【定时任务】检查设备是否超维保期限使用 + deviceOvertimeCron: 0 0 1 * * ? + #【定时任务】检测提报任务是否超时 + taskOvertimeCron: 0 1 0 * * ? + #【定时任务】任务发布 + taskPublishCron: 0 0 1 * * ? + #【定时任务】任务到期终止 + taskExpireCron: 0 1 0 * * ? + #【定时任务】检查禁用后重启用的员工并重启用 + reEnableEmplyeeCron: 0 0 0 * * ? + #【定时任务】检查禁用后重启用的机构并重启用 + reEnableDeptCron: 0 0 0 * * ? + #【定时任务】检查工作提醒是否超过提醒结束日期 + remindNoteOvertimeCron: 0 1 0 * * ? + #【定时任务】触发同步机构员工 + syncEmpDeptCron: 0 0 1 * * ? diff --git a/doc/nacos/config/prod/blade-prod.yaml b/doc/nacos/config/prod/blade-prod.yaml index 13c4e83..40cc24a 100644 --- a/doc/nacos/config/prod/blade-prod.yaml +++ b/doc/nacos/config/prod/blade-prod.yaml @@ -48,7 +48,7 @@ blade: username: htb_ap_obcluster:sis:secretiy password: SECRETIY_P@ssw0rd@123 -#security-busi-yml配置 +#ht-security-yml配置 #通用配置参数 common: projectRoleName: 安全员 #项目预算管理-项目结项后可以对结项项目进行操作的指属上一级机构的角色名称 @@ -123,3 +123,28 @@ single: scvcd: 30430034 #上esb获取用户信息的服务码 user-url: http://197.32.39.34:8000/security-auth/oauth/token #应用系统获取token地址 chnl-tp: 41022 + +#定时任务参数配置 +schedule: + #【定时任务】自动生成设备检查任务 + deviceInspectionCron: 0 0 1 * * ? + #【定时任务】设备类型变更关联设备检查对应字段变更 + deviceCatgChangeCron: 0 0 3 * * ? + #【定时任务】设备检查是否超时 + deviceInspOvertimeCron: 0 1 0 * * ? + #【定时任务】检查设备是否超维保期限使用 + deviceOvertimeCron: 0 0 1 * * ? + #【定时任务】检测提报任务是否超时 + taskOvertimeCron: 0 1 0 * * ? + #【定时任务】任务发布 + taskPublishCron: 0 0 1 * * ? + #【定时任务】任务到期终止 + taskExpireCron: 0 1 0 * * ? + #【定时任务】检查禁用后重启用的员工并重启用 + reEnableEmplyeeCron: 0 0 0 * * ? + #【定时任务】检查禁用后重启用的机构并重启用 + reEnableDeptCron: 0 0 0 * * ? + #【定时任务】检查工作提醒是否超过提醒结束日期 + remindNoteOvertimeCron: 0 1 0 * * ? + #【定时任务】触发同步机构员工 + syncEmpDeptCron: 0 0 1 * * ? diff --git a/doc/nacos/config/test/blade-test.yaml b/doc/nacos/config/test/blade-test.yaml index 2a5319b..c469417 100644 --- a/doc/nacos/config/test/blade-test.yaml +++ b/doc/nacos/config/test/blade-test.yaml @@ -125,3 +125,28 @@ common: securityRoleName: 安全员 #安保指挥中心非现场检查整改通知书通知机构的角色 payPlanRemindKeyName: payPlanRemindDay #付款计划提醒提前天数字典配置键值 concatDeadlineRemindKeyName: concatDeadlineRemindDay #合同到期提醒提前天数字典配置键值 + +#定时任务参数配置 +schedule: + #【定时任务】自动生成设备检查任务 + deviceInspectionCron: 0 0 1 * * ? + #【定时任务】设备类型变更关联设备检查对应字段变更 + deviceCatgChangeCron: 0 0 3 * * ? + #【定时任务】设备检查是否超时 + deviceInspOvertimeCron: 0 1 0 * * ? + #【定时任务】检查设备是否超维保期限使用 + deviceOvertimeCron: 0 0 1 * * ? + #【定时任务】检测提报任务是否超时 + taskOvertimeCron: 0 1 0 * * ? + #【定时任务】任务发布 + taskPublishCron: 0 0 1 * * ? + #【定时任务】任务到期终止 + taskExpireCron: 0 1 0 * * ? + #【定时任务】检查禁用后重启用的员工并重启用 + reEnableEmplyeeCron: 0 0 0 * * ? + #【定时任务】检查禁用后重启用的机构并重启用 + reEnableDeptCron: 0 0 0 * * ? + #【定时任务】检查工作提醒是否超过提醒结束日期 + remindNoteOvertimeCron: 0 1 0 * * ? + #【定时任务】触发同步机构员工 + syncEmpDeptCron: 0 0 1 * * ? diff --git a/doc/nginx/dev/nginx.conf b/doc/nginx/dev/nginx.conf index 73a700c..25a85ae 100644 --- a/doc/nginx/dev/nginx.conf +++ b/doc/nginx/dev/nginx.conf @@ -82,15 +82,15 @@ http { listen 8887; server_name web-test; location ^~ /sis/ { - proxy_pass http://127.0.0.1:8889; + proxy_pass http://127.0.0.1:8889; } } - + server { listen 8888; server_name web; - #root /home/test/apps/security-manage/security/dist; - + #root /home/test/apps/ht-security-manage/security/dist; + ##location /file/ { ## root /home/test/apps; ## autoindex on; @@ -141,7 +141,7 @@ http { index index.html; try_files $uri $uri/ /@router; } - + location @router { rewrite ^.*$ /index.html last; } diff --git a/doc/nginx/test/nginx.conf b/doc/nginx/test/nginx.conf index b980321..0ee4c5e 100644 --- a/doc/nginx/test/nginx.conf +++ b/doc/nginx/test/nginx.conf @@ -82,7 +82,7 @@ http { server { listen 8888; server_name web; - #root /home/test/apps/security-manage/security/dist; + #root /home/test/apps/ht-security-manage/security/dist; #location /file/ { # root /home/test/apps; diff --git a/doc/sql/clean-flow-business.sql b/doc/sql/clean-flow-business.sql index b843a3a..c0b2b57 100644 --- a/doc/sql/clean-flow-business.sql +++ b/doc/sql/clean-flow-business.sql @@ -51,7 +51,7 @@ delete from act_ru_execution; -- 考核评价 update t_assessment set process_definition_id = null, process_instance_id = null, state = '0'; -- 设备检查/整改/持续整改 -update t_device_inspection set process_definition_id = null, process_instance_id = null, ins_process_definition_id = null, ins_process_instance_id = null, rec_process_definition_id = null, rec_process_instance_id = null, state = '0'; +update t_device_inspection set process_definition_id = null, process_instance_id = null, ins_process_definition_id = null, ins_process_instance_id = null, rec_process_definition_id = null, rec_process_instance_id = null,state = '0';-- 设备检查明细 -- 设备检查明细 update t_device_inspection_line set process_definition_id = null, process_instance_id = null, state = '0'; -- 值班备勤 diff --git a/pom.xml b/pom.xml index 8c3830e..51fa4d4 100644 --- a/pom.xml +++ b/pom.xml @@ -139,13 +139,13 @@ - - com.spotify - dockerfile-maven-plugin - - true - - + + + + + + + org.springframework.boot spring-boot-maven-plugin diff --git a/security-service-api/ht-security-api/pom.xml b/security-service-api/ht-security-api/pom.xml new file mode 100644 index 0000000..a4f2d18 --- /dev/null +++ b/security-service-api/ht-security-api/pom.xml @@ -0,0 +1,27 @@ + + + + security-service-api + org.security + 2.8.1.RELEASE + + 4.0.0 + + ht-security-api + ${project.artifactId} + ${bladex.project.version} + + + org.springframework.cloud + spring-cloud-openfeign-core + 2.2.8.RELEASE + compile + + + jar + + + + diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Department.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Department.java new file mode 100644 index 0000000..e7c86b5 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Department.java @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.entity.basic; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 基础信息-组织机构实体类 + * + * @author BladeX + * @since 2022-03-07 + */ +@Data +@TableName("T_DEPARTMENT") +@ApiModel(value = "Department对象", description = "基础信息-组织机构") +public class Department implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 创建人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createdBy; + /** + * 创建时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createdTime; + /** + * 更新人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + /** + * 更新时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updatedTime; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private Long id; + /** + * 上级机构id + */ + @ApiModelProperty(value = "上级机构id") + @TableField("PARENT_ID") + private Long parentId; + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @TableField("DEPT_NAME") + private String deptName; + /** + * 机构全称 + */ + @ApiModelProperty(value = "机构全称") + @TableField("FULL_NAME") + private String fullName; + + /** + * 祖级机构主键 + */ + @ApiModelProperty(value = "祖级机构主键") + @TableField("ANCESTORS") + private String ancestors; + /** + * 机构层级 + */ + @ApiModelProperty(value = "层级") + @TableField("DEPT_LEVEL") + private String deptLevel; + /** + * 机构简介 + */ + @ApiModelProperty(value = "机构简介") + @TableField("SUMMARY") + private String summary; + /** + * 地址 + */ + @ApiModelProperty(value = "地址") + @TableField("ADDRESS") + private String address; + /** + * 毗邻单位东 + */ + @ApiModelProperty(value = "毗邻单位") + @TableField("NEIGHBOR_DEPT") + private String neighborDept; + /** + * 建设时间 + */ + @ApiModelProperty(value = "建设时间") + @TableField("CONSTRUCTION_DATE") + private String constructionDate; + /** + * 开业时间 + */ + @ApiModelProperty(value = "开业时间") + @TableField("OPEN_DATE") + private String openDate; + /** + * 主要负责人 + */ + @ApiModelProperty(value = "主要负责人") + @TableField("LEADER") + private String leader; + /** + * 安全员 + */ + @ApiModelProperty(value = "安全员") + @TableField("SAFETY_OFFICER") + private String safetyOfficer; + /** + * 分管领导 + */ + @ApiModelProperty(value = "分管领导") + @TableField("LEADER_IN_CHARGE") + private String leaderInCharge; + /** + * 人数 + */ + @ApiModelProperty(value = "人数") + @TableField("PEOPLE_NUMBER") + private Integer peopleNumber; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + /** + * 机构号 + */ + @ApiModelProperty(value = "机构号") + @TableField("DEPT_NO") + private String deptNo; + /** + * 设计资料文件地址 + */ + @ApiModelProperty(value = "设计资料文件地址") + @TableField("DESIGN_DATA") + private String designData; + /** + * 建设资料文件地址 + */ + @ApiModelProperty(value = "建设资料文件地址") + @TableField("CONSTRUCTION_DATA") + private String constructionData; + /** + * 验收资料文件地址 + */ + @ApiModelProperty(value = "验收资料文件地址") + @TableField("ACCEPTANCE_DATA") + private String acceptanceData; + /** + * 自助银行类型:1-行内、2-离行 + */ + @ApiModelProperty(value = "自助银行类型:1-行内、2-离行") + @TableField("SELF_BANK_TYPE") + private String selfBankType; + + /** + * 机构类型:1-总行、2-分行、3-支行、4-自助银行 + */ + @ApiModelProperty(value = "机构类型:1-总行、2-分行、3-支行、4-自助银行") + @TableField("DEPT_CATEGORY") + private String deptCategory; + + + /** + * 机构经度 + */ + @ApiModelProperty(value = "机构经度") + @TableField("LONGITUDE") + private String longitude; + + /** + * 机构纬度 + */ + @ApiModelProperty(value = "机构纬度") + @TableField("LATITUDE") + private String latitude; + /** + * 机构照片groupName + */ + @ApiModelProperty(value = "机构照片groupName") + @TableField("GROUP_NAME") + private String groupName; + /** + * 机构证照groupName + */ + @ApiModelProperty(value = "机构证照groupName") + @TableField("QUA_GROUP_NAME") + private String quaGroupName; + /** + * 成立时间 + */ + @ApiModelProperty(value = "成立时间") + @TableField("ESTABLISH_DATE") + private String establishDate; + /** + * 改建/扩建时间 + */ + @ApiModelProperty(value = "改建/扩建时间") + @TableField("REBUILD_DATE") + private String rebuildDate; + /** + * 场所面积 + */ + @ApiModelProperty(value = "场所面积") + @TableField("AREA") + private String area; + /** + * 其他 + */ + @ApiModelProperty(value = "其他") + @TableField("OTHER") + private String other; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Device.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Device.java new file mode 100644 index 0000000..5ff6f72 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Device.java @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.entity.basic; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 基础信息-设备信息实体类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Data +@TableName("T_DEVICE") +@ApiModel(value = "Device对象", description = "基础信息-设备信息") +public class Device implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 创建人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createdBy; + /** + * 创建时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createdTime; + /** + * 更新人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + /** + * 更新时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updatedTime; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @TableField("NAME") + private String name; + /** + * 设备编号 + */ + @ApiModelProperty(value = "设备编号") + @TableField("DEVICE_NUM") + private String deviceNum; + /** + * 二维码 + */ + @ApiModelProperty(value = "二维码") + @TableField("QR_CODE") + private String qrCode; + /** + * 设备类型 + */ + @ApiModelProperty(value = "设备类型") + @TableField("TYPE_ID") + private String typeId; + /** + * 设备类型 + */ + @ApiModelProperty(value = "类型层级") + @TableField("TYPE_RANK") + private String typeRank; + /** + * 所属机构 + */ + @ApiModelProperty(value = "所属机构") + @TableField("DEP_ID") + private String depId; + /** + * 所属机构名称 + */ + @ApiModelProperty(value = "所属机构名称") + @TableField("DEPT_NAME") + private String deptName; + /** + * 放置地址 + */ + @ApiModelProperty(value = "放置地址") + @TableField("ADDRESS") + private String address; + /** + * 购买时间 + */ + @ApiModelProperty(value = "购买时间") + @TableField("BUY_DATE") + private String buyDate; + /** + * 安装时间 + */ + @ApiModelProperty(value = "安装时间") + @TableField("INSTALL_DATE") + private String installDate; + /** + * 设备处置时间(原到期时间) + */ + @ApiModelProperty(value = "设备处置时间") + @TableField("END_DATE") + private String endDate; + /** + * 维保期限 + */ + @ApiModelProperty(value = "维保期限") + @TableField("MAINTENANCE_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date maintenanceDate; + /** + * 设备厂商 + */ + @ApiModelProperty(value = "设备厂商") + @TableField("COMPANY") + private String company; + /** + * 设备型号 + */ + @ApiModelProperty(value = "设备型号") + @TableField("MODEL_NUM") + private String modelNum; + /** + * 设备照片 + */ + @ApiModelProperty(value = "设备照片") + @TableField("PIC_IDS") + private String picIds; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARK") + private String remark; + /** + * 设备使用状态;0-未使用 1-正常使用中 2-超期使用中 3-已处置 + */ + @ApiModelProperty(value = "设备使用状态;0-未使用 1-正常使用中 2-超期使用中 3-已处置") + @TableField("USAGE_STATE") + private String usageState; + /** + * 设备检查状态;4-检查中,5-检查完成,6-待整改,7-整改完成,8-超期未检查 + */ + @ApiModelProperty(value = "设备检查状态;4-检查中,5-检查完成,6-待整改,7-整改完成,8-超期未检查") + @TableField("STATE") + private String state; + /** + * 原设备使用状态;0-未使用 1-正常使用中 2-超期使用中 3-超期未使用 + */ + @ApiModelProperty(value = "原设备使用状态") + @TableField("ORG_STATE") + private String orgState; + /** + *检查频次 + */ + @ApiModelProperty(value = "检查频次") + @TableField("FREQUENCY") + private String frequency; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 像素 + */ + @ApiModelProperty(value = "像素") + @TableField("PIXEL") + private String pixel; + /** + * 满足标准 + */ + @ApiModelProperty(value = "满足标准") + @TableField("STANDARD") + private String standard; + /** + * 最近检查时间 + */ + @ApiModelProperty(value = "最近检查时间") + @TableField("LATEST_INSPECTION_TIME") + private Date latestInspectionTime; + /** + * 设备状态(0-故障,1-正常) + */ + @ApiModelProperty(value = "设备状态(0-故障,1-正常)") + @TableField("DEVICE_STATE") + private String deviceState; + /** + * 附件groupName + */ + @ApiModelProperty(value = "附件groupName") + @TableField("GROUP_NAME") + private String groupName; + + @ApiModelProperty(value = "角色ID") + private String roleId; + + @ApiModelProperty(value = "检查人ID") + private String dutyUserId; + + @ApiModelProperty(value = "检查人姓名") + private String dutyUserName; + + /** + * 安装方 + */ + @ApiModelProperty(value = "安装方") + @TableField("INSTALLER") + private String installer; + /** + * 是否自动检查维保到期情况(0-否 1-是) + */ + @ApiModelProperty(value = "是否自动检查维保到期情况(0-否 1-是)") + @TableField("AUTO_CHECK") + private String autoCheck; + /** + * 不自动检查维保到期的原因 + */ + @ApiModelProperty(value = "不自动检查维保到期的原因") + @TableField("AUTO_REASON") + private String autoReason; + /** + * 检查时必须先扫码(0-否 1-是) + */ + @ApiModelProperty(value = "检查时必须先扫码(0-否 1-是)") + @TableField("NEED_SCAN") + private String needScan; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Employee.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Employee.java new file mode 100644 index 0000000..6c5a78c --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Employee.java @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.entity.basic; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.*; + +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 基础信息-员工实体类 + * + * @author BladeX + * @since 2022-03-07 + */ +@Data +@TableName("T_EMPLOYEE") +@ApiModel(value = "Employee对象", description = "基础信息-员工") +public class Employee extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门ID + */ + @ApiModelProperty(value = "部门ID") + @TableField("DEPT_ID") + private String deptId; + /** + * 是否借调 (0-否 1-是) + */ + @ApiModelProperty(value = "是否借调 (0-否 1-是)") + @TableField("IS_SECONDED") + private String isSeconded; + /** + * 被借调前原部门ID + */ + @ApiModelProperty(value = "原部门ID") + @TableField("SECOND_DEPT_ID") + private String secondDeptId; + /** + * 姓名 + */ + @ApiModelProperty(value = "姓名") + @TableField("NAME") + private String name; + /** + * 性别 + */ + @ApiModelProperty(value = "性别") + @TableField("GENDER") + private String gender; + /** + * 年龄 + */ + @ApiModelProperty(value = "年龄") + @TableField("AGE") + private String age; + /** + * 出生日期 + */ + @ApiModelProperty(value = "出生日期") + @TableField("BIRTHDAY") + private String birthday; + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + @TableField("ID_CARD") + private String idCard; + /** + * 民族 + */ + @ApiModelProperty(value = "民族") + @TableField("NATION") + private String nation; + /** + * 政治面貌 + */ + @ApiModelProperty(value = "政治面貌") + @TableField("POLITICS") + private String politics; + /** + * 参加工作时间 + */ + @ApiModelProperty(value = "参加工作时间") + @TableField("WORK_BEGIN_DATE") + private String workBeginDate; + /** + * 专业技术职称 + */ + @ApiModelProperty(value = "专业技术职称") + @TableField("JOB_TITLE") + private String jobTitle; + /** + * 岗位 + */ + @ApiModelProperty(value = "岗位") + @TableField("JOB") + private String job; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + @TableField("PHONE") + private String phone; + /** + * 通讯地址 + */ + @ApiModelProperty(value = "通讯地址") + @TableField("ADDRESS") + private String address; + /** + * 毕业院校 + */ + @ApiModelProperty(value = "毕业院校") + @TableField("SCHOOL") + private String school; + /** + * 最高学历 + */ + @ApiModelProperty(value = "最高学历") + @TableField("EDUCATION") + private String education; + /** + * 身份证正面 + */ + @ApiModelProperty(value = "身份证正面") + @TableField("ID_CARD_FRONT") + private String idCardFront; + /** + * 身份证反面 + */ + @ApiModelProperty(value = "身份证反面") + @TableField("ID_CARD_BACK") + private String idCardBack; + /** + * 证件照 + */ + @ApiModelProperty(value = "证件照") + @TableField("PIC") + private String pic; + /** + * 状态;1-正常 2-异常 + */ + @ApiModelProperty(value = "状态;1-正常 2-异常") + @TableField("STATE") + private BigDecimal state; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value ="逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 入职日期 + */ + @ApiModelProperty(value = "入职日期") + @TableField("JOB_DATE") + private String jobDate; + /** + * 岗位类型 (1-机构负责人,2-安全部门负责人,3-安全员,4-义务消防员,5-其他) + */ + @ApiModelProperty(value = "岗位类型 (1-机构负责人,2-安全部门负责人,3-安全员,4-义务消防员,5-其他)") + @TableField("CIVILAIR_DEFENSE_TYPE") + private String civilAirDefenseType; + /** + * 员工号 + */ + @ApiModelProperty(value = "员工号") + @TableField("EMPLOYEE_NO") + private String employeeNo; + /** + * 分管领导ID + */ + @ApiModelProperty(value = "分管领导") + @TableField("LEADER") + private String leader; + + @ApiModelProperty(value = "证件照groupname") + @TableField("GROUP_NAME_head") + private String groupNameHead; + + @ApiModelProperty(value = "身份证正面照groupname") + @TableField("GROUP_NAME_FRONT") + private String groupNameFront; + + @ApiModelProperty(value = "身份证背面照groupname") + @TableField("GROUP_NAME_BACK") + private String groupNameBack; + + @ApiModelProperty(value = "附件groupname") + @TableField("GROUP_NAME") + private String groupName; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Family.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Family.java new file mode 100644 index 0000000..d1f3aa4 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Family.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.entity.basic; + +import com.baomidou.mybatisplus.annotation.*; + +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 基础信息-员工家庭成员实体类 + * + * @author BladeX + * @since 2022-03-08 + */ +@Data +@TableName("T_FAMILY") +@ApiModel(value = "Family对象", description = "基础信息-员工家庭成员") +public class Family implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 创建人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createdBy; + /** + * 创建时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createdTime; + /** + * 更新人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + /** + * 更新时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updatedTime; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 员工ID + */ + @ApiModelProperty(value = "员工ID") + @TableField("EMPLOYEE_ID") + private String employeeId; + /** + * 姓名 + */ + @ApiModelProperty(value = "姓名") + @TableField("NAME") + private String name; + /** + * 与本人关系 + */ + @ApiModelProperty(value = "与本人关系") + @TableField("RELATIONSHIP") + private String relationship; + /** + * 出生年月 + */ + @ApiModelProperty(value = "出生年月") + @TableField("BIRTH") + private String birth; + /** + * 性别 + */ + @ApiModelProperty(value = "性别") + @TableField("GENDER") + private String gender; + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + @TableField("ID_CARD") + private String idCard; + /** + * 工作单位 + */ + @ApiModelProperty(value = "工作单位") + @TableField("WORK_PLACE") + private String workPlace; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + @TableField("PHONE") + private String phone; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 备用字段1 + */ + @ApiModelProperty(value = "备用字段1") + @TableField("RESERVE1") + private String reserve1; + /** + * 备用字段2 + */ + @ApiModelProperty(value = "备用字段2") + @TableField("RESERVE2") + private String reserve2; + /** + * 备用字段3 + */ + @ApiModelProperty(value = "备用字段3") + @TableField("RESERVE3") + private String reserve3; + /** + * 备用字段4 + */ + @ApiModelProperty(value = "备用字段4") + @TableField("RESERVE4") + private String reserve4; + /** + * 备用字段5 + */ + @ApiModelProperty(value = "备用字段5") + @TableField("RESERVE5") + private String reserve5; + + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/JobRecord.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/JobRecord.java new file mode 100644 index 0000000..69cb520 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/JobRecord.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.entity.basic; + +import com.baomidou.mybatisplus.annotation.*; + +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 基础信息-员工工作履历实体类 + * + * @author BladeX + * @since 2022-03-08 + */ +@Data +@TableName("T_JOB_RECORD") +@ApiModel(value = "JobRecord对象", description = "基础信息-员工工作履历") +public class JobRecord implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 创建人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createdBy; + /** + * 创建时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createdTime; + /** + * 更新人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + /** + * 更新时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updatedTime; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 员工ID + */ + @ApiModelProperty(value = "员工ID") + @TableField("EMPLOYEE_ID") + private String employeeId; + /** + * 工作单位 + */ + @ApiModelProperty(value = "工作单位") + @TableField("PLACE") + private String place; + /** + * 起始时间 + */ + @ApiModelProperty(value = "起始时间") + @TableField("BEGIN_DATE") + private String beginDate; + /** + * 截止时间 + */ + @ApiModelProperty(value = "截止时间") + @TableField("END_DATE") + private String endDate; + /** + * 岗位或工作 + */ + @ApiModelProperty(value = "岗位或工作") + @TableField("JOB") + private String job; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 备用字段1 + */ + @ApiModelProperty(value = "备用字段1") + @TableField("RESERVE1") + private String reserve1; + /** + * 备用字段2 + */ + @ApiModelProperty(value = "备用字段2") + @TableField("RESERVE2") + private String reserve2; + /** + * 备用字段3 + */ + @ApiModelProperty(value = "备用字段3") + @TableField("RESERVE3") + private String reserve3; + /** + * 备用字段4 + */ + @ApiModelProperty(value = "备用字段4") + @TableField("RESERVE4") + private String reserve4; + /** + * 备用字段5 + */ + @ApiModelProperty(value = "备用字段5") + @TableField("RESERVE5") + private String reserve5; + + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Law.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Law.java new file mode 100644 index 0000000..6488922 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/Law.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.entity.basic; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 实体类 + * + * @author BladeX + * @since 2022-05-30 + */ +@Data +@TableName("T_LAW") +@ApiModel(value = "Law对象", description = "Law对象") +public class Law extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @TableField("NAME") + private String name; + /** + * 类型 1-内部规章制度 2-外部法律法规 + */ + @ApiModelProperty(value = "类型 1-内部规章制度 2-外部法律法规") + @TableField("TYPE") + private String type; + /** + * 上传机构 + */ + @ApiModelProperty(value = "上传机构") + @TableField("DEPT_ID") + private String deptId; + /** + * 状态;1-可用 0-停用 + */ + @ApiModelProperty(value = "状态;1-可用 0-停用") + @TableField("STATE") + private String state; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;1-删除,0-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 法律法规类型(1-安防类,2-其他类) + */ + @ApiModelProperty(value = "法律法规类型(1-安防类,2-其他类)") + @TableField("LAW_TYPE") + private String lawType; + /** + * 附件groupname + */ + @ApiModelProperty(value = "附件groupname") + @TableField("GROUP_NAME") + private String groupName; + /** + * 启用时间 + */ + @ApiModelProperty(value = "启用时间") + private Date openTime; + /** + * 停用时间 + */ + @ApiModelProperty(value = "停用时间") + private Date closeTime; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/MailList.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/MailList.java new file mode 100644 index 0000000..2177a77 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/MailList.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.entity.basic; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 基础信息-联系信息表实体类 + * + * @author BladeX + * @since 2022-05-18 + */ +@Data +@TableName("T_MAIL_LIST") +@ApiModel(value = "MailList对象", description = "基础信息-联系信息表") +public class MailList implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 机构办公室电话 + */ + @ApiModelProperty(value = "机构办公室电话") + @TableField("OFFICE_TEL") + private String officeTel; + /** + * 分管领导 + */ + @ApiModelProperty(value = "分管领导") + @TableField("LEADER_IN_CHARGE") + private String leaderInCharge; + /** + * 安保负责人 + */ + @ApiModelProperty(value = "安保负责人") + @TableField("HEAD_OF_SECURITY") + private String headOfSecurity; + /** + * 安保负责人电话 + */ + @ApiModelProperty(value = "安保负责人电话") + @TableField("HEAD_OF_SECURITY_TEL") + private String headOfSecurityTel; + /** + * 安全员 + */ + @ApiModelProperty(value = "安全员") + @TableField("SAFETY_OFFICER") + private String safetyOfficer; + /** + * 安全员电话 + */ + @ApiModelProperty(value = "安全员电话") + @TableField("SAFETY_OFFICER_TEL") + private String safetyOfficerTel; + /** + * 辖区派出所 + */ + @ApiModelProperty(value = "辖区派出所") + @TableField("LOCAL_POLICE_STATION") + private String localPoliceStation; + /** + * 辖区派出所电话 + */ + @ApiModelProperty(value = "辖区派出所电话") + @TableField("LOCAL_POLICE_STATION_TEL") + private String localPoliceStationTel; + /** + * 片区警员 + */ + @ApiModelProperty(value = "片区警员") + @TableField("DISTRICT_POLICE_OFFICER") + private String districtPoliceOfficer; + /** + * 片区警员电话 + */ + @ApiModelProperty(value = "片区警员电话") + @TableField("DISTRICT_POLICE_OFFICER_TEL") + private String districtPoliceOfficerTel; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + @TableField("CREATED_BY") + private String createdBy; + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + @TableField("CREATED_TIME") + private LocalDateTime createdTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + @TableField("UPDATED_BY") + private String updatedBy; + /** + * 更新时间 + */ + @ApiModelProperty(value = "更新时间") + @TableField("UPDATED_TIME") + private LocalDateTime updatedTime; + + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/SelfHelpBank.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/SelfHelpBank.java new file mode 100644 index 0000000..1ed0261 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/basic/SelfHelpBank.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.entity.basic; + +import com.baomidou.mybatisplus.annotation.*; + +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 基础信息-自助银行实体类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Data +@TableName("T_SELF_HELP_BANK") +@ApiModel(value = "SelfHelpBank对象", description = "基础信息-自助银行") +public class SelfHelpBank implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 创建人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createdBy; + /** + * 创建时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createdTime; + /** + * 更新人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + /** + * 更新时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updatedTime; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @TableField("NAME") + private String name; + /** + * 所属网点 + */ + @ApiModelProperty(value = "所属网点") + @TableField("DEPT_ID") + private String deptId; + /** + * 类型;1-行内 2-离行 + */ + @ApiModelProperty(value = "类型;1-行内 2-离行") + @TableField("TYPE") + private String type; + /** + * 概述 + */ + @ApiModelProperty(value = "概述") + @TableField("SUMMARY") + private String summary; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 地址 + */ + @ApiModelProperty(value = "地址") + @TableField("ADDRESS") + private String address; + /** + * 备用字段2 + */ + @ApiModelProperty(value = "备用字段2") + @TableField("RESERVE2") + private String reserve2; + /** + * 备用字段3 + */ + @ApiModelProperty(value = "备用字段3") + @TableField("RESERVE3") + private String reserve3; + /** + * 备用字段4 + */ + @ApiModelProperty(value = "备用字段4") + @TableField("RESERVE4") + private String reserve4; + /** + * 备用字段5 + */ + @ApiModelProperty(value = "备用字段5") + @TableField("RESERVE5") + private String reserve5; + + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/BaseEntity.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/BaseEntity.java new file mode 100644 index 0000000..0091456 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/BaseEntity.java @@ -0,0 +1,58 @@ +package org.security.ht.entity.common; + +//import com.alibaba.excel.annotation.ExcelIgnore; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 自动填充创建时间、创建人、更新时间、更新人 + * @author Create by wzf + * @date 2022/4/15 16:22 + */ +@Data +public class BaseEntity { + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + + /** + * 创建人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createdBy; + /** + * 创建时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createdTime; + /** + * 更新人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + /** + * 更新时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updatedTime; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/File.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/File.java new file mode 100644 index 0000000..0fe7709 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/File.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.entity.common; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 公共-附件表实体类 + * + * @author BladeX + * @since 2022-07-04 + */ +@Data +@TableName("T_FILE") +@ApiModel(value = "File对象", description = "公共-附件表") +public class File extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 文件名称 + */ + @ApiModelProperty(value = "文件名称") + @TableField("FILE_NAME") + private String fileName; + /** + * 上送影像平台附件标识id + */ + @ApiModelProperty(value = "上送影像平台附件标识id") + @TableField("content_id") + private String contentId; + /** + * 格式 + */ + @ApiModelProperty(value = "格式") + @TableField("FORMAT") + private String format; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + /** + * 关联ID + */ + @ApiModelProperty(value = "关联ID") + @TableField("LINK_ID") + private String linkId; + + @ApiModelProperty(value = "业务开始时间") + @TableField("busi_begin_date") + private String busiBeginDate; + + @ApiModelProperty(value = "分组名称") + @TableField("GROUP_NAME") + private String groupName; + + @ApiModelProperty(value = "本地文件路径") + @TableField("local_url") + private String localUrl; + + @ApiModelProperty(value = "是否是加密文件") + @TableField("encrypt") + private Boolean encrypt; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/FlowEntity.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/FlowEntity.java new file mode 100644 index 0000000..0a6ee32 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/entity/common/FlowEntity.java @@ -0,0 +1,35 @@ +package org.security.ht.entity.common; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author: qxqx + * @Create: 2022/9/6 + * @Description: 审批流实体 + */ +@Data +public class FlowEntity extends BaseEntity { + + /** + * 状态 (0-任务未审批状态,1-任务审批中状态,2-任务审批完成状态(已审批完毕,或无需审批的任务自行进行确认),3-任务审批驳回状态) + */ + @ApiModelProperty(value = "状态") + @TableField("STATE") + private String state; + + /** + * 流程定义id + */ + @ApiModelProperty(value = "流程定义id") + @TableField("PROCESS_DEFINITION_ID") + private String processDefinitionId; + /** + * 流程实例id + */ + @ApiModelProperty(value = "流程实例id") + @TableField("PROCESS_INSTANCE_ID") + private String processInstanceId; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/IHtClient.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/IHtClient.java new file mode 100644 index 0000000..e802bc1 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/IHtClient.java @@ -0,0 +1,64 @@ +package org.security.ht.feign; + +import org.security.common.constant.CommonConstant; +import org.springblade.core.tool.api.R; +import org.springframework.cloud.openfeign.FeignClient; +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.RequestParam; + +import java.util.Map; + +@FeignClient( + value = CommonConstant.APPLICATION_SECURITY +) +public interface IHtClient { + + String API_PREFIX = "/client"; + String UPDATE_STATE_BY_ID = API_PREFIX + "/update-state-by-id"; + String SEND_ALARM_NOTICE = API_PREFIX + "/send-alarm-notice"; + String SEND_SCC_CHECK_NOTICE = API_PREFIX + "/send-scc-check-notice"; + String AFTER_FLOW_FINISHED = API_PREFIX + "/after-flow-finished"; + + /** + * 根据id修改状态 + * + * @param serviceBeanName serviceBean名称 + * @param id 主键 + * @param state 状态 + * @return + */ + @GetMapping(UPDATE_STATE_BY_ID) + R updateStateById(@RequestParam("serviceBeanName") String serviceBeanName, @RequestParam("id") String id, @RequestParam("state") String state); + + /** + * 根据id修改状态 + * + * @param serviceBeanName serviceBean名称 + * @param id 主键 + * @param pass 是否通过 + * @param variables service需要用到的参数 + * @return + */ + @PostMapping(AFTER_FLOW_FINISHED) + R afterFlowFinished(@RequestParam("serviceBeanName") String serviceBeanName, @RequestParam("id") String id, @RequestParam(value = "pass", required = false) Boolean pass, @RequestBody Map variables); + + /** + * 警情推送 + * + * @param answerAlarmId 接警记录id + * @return + */ + @GetMapping(SEND_ALARM_NOTICE) + R sendAlarmNotice(@RequestParam("answerAlarmId") String answerAlarmId); + + /** + * 下发整改通知书 + * + * @param sccCheckId 接警记录id + * @return + */ + @GetMapping(SEND_SCC_CHECK_NOTICE) + R sendSccCheckNotice(@RequestParam("sccCheckId") String sccCheckId); +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/IHtClientFallback.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/IHtClientFallback.java new file mode 100644 index 0000000..a1250e9 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/IHtClientFallback.java @@ -0,0 +1,39 @@ +package org.security.ht.feign; + +import org.springblade.core.tool.api.R; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.GetMapping; + +import java.util.Map; + +/** + * @Author: qxqx + * @Create: 2022/8/26 + * @Description: + */ +@Component +public class IHtClientFallback implements IHtClient { + + @Override + @GetMapping(UPDATE_STATE_BY_ID) + public R updateStateById(String serviceBeanName, String id, String state) { + return R.fail("远程调用失败"); + } + + @Override + @GetMapping(SEND_ALARM_NOTICE) + public R sendAlarmNotice(String answerAlarmId) { + return R.fail("远程调用失败"); + } + + @Override + @GetMapping(SEND_SCC_CHECK_NOTICE) + public R sendSccCheckNotice(String sccCheckId) { + return R.fail("远程调用失败"); + } + + @Override + public R afterFlowFinished(String serviceBeanName, String id, Boolean pass, Map variables) { + return R.fail("远程调用失败"); + } +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/DepartmentClientFallback.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/DepartmentClientFallback.java new file mode 100644 index 0000000..65f8b56 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/DepartmentClientFallback.java @@ -0,0 +1,28 @@ +package org.security.ht.feign.basic; + +import org.security.ht.entity.basic.Department; +import org.springblade.core.tool.api.R; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author :wzf + * @apiNote :Department 微服务掉用服务熔断 + * @since :Created in 2022/9/19 11:41 + */ +@Component +public class DepartmentClientFallback implements IDepartmentClient{ + @Override + public R saveData(List departmentList) { + return R.fail("保存Department-机构信息服务远程调用失败"); + } + @Override + public R removeData(String ids) { + return R.fail("删除Department-机构信息服务远程调用失败"); + } + @Override + public R deptInfoById(String deptId) { + return R.fail("查询机构详情失败远程调用失败"); + } +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/EmployeeClientFallback.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/EmployeeClientFallback.java new file mode 100644 index 0000000..79f8a8c --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/EmployeeClientFallback.java @@ -0,0 +1,30 @@ +package org.security.ht.feign.basic; + +import org.security.ht.entity.basic.Employee; +import org.springblade.core.tool.api.R; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author :wzf + * @apiNote :Employee 微服务掉用服务熔断 + * @since :Created in 2022/9/19 14:11 + */ +@Component +public class EmployeeClientFallback implements IEmployeeClient{ + @Override + public R getEmployeeAndFamiliesAndJobRecords(Long id) { + return R.fail("获取Employee-员工信息服务远程调用失败"); + } + + @Override + public R synData(List employees) { + return R.fail("同步Employee-员工信息远程调用失败"); + } + + @Override + public R removeData(String id) { + return R.fail("删除Employee-员工信息远程调用失败"); + } +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/IDepartmentClient.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/IDepartmentClient.java new file mode 100644 index 0000000..6aaf438 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/IDepartmentClient.java @@ -0,0 +1,48 @@ +package org.security.ht.feign.basic; + +import org.security.common.constant.CommonConstant; +import org.security.ht.entity.basic.Department; +import org.springblade.core.tool.api.R; +import org.springframework.cloud.openfeign.FeignClient; +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.RequestParam; + +import java.util.List; + +/** + * @author :wzf + * @apiNote :Department Feign接口类 + * @since :Created in 2022/9/19 11:26 + */ +@FeignClient( + value = CommonConstant.APPLICATION_SECURITY, + fallback = DepartmentClientFallback.class +) +public interface IDepartmentClient { + + String API_PREFIX = "/client"; + String SYN_SAVE_DATA = API_PREFIX + "/syn/save/department"; + String SYN_REMOVE_DATA = API_PREFIX + "/syn/remove/department"; + String DEPT_INFO_BY_ID = API_PREFIX + "/deptInfoById"; + + /** + *消息总线信息同步,更新机构信息 + */ + @PostMapping(SYN_SAVE_DATA) + R saveData(@RequestBody List departmentList); + /** + *消息总线信息同步,删除未启用机构 + */ + @PostMapping(SYN_REMOVE_DATA) + R removeData(@RequestBody String ids); + /** + * 获取机构信息 + * + * @param deptId 部门id + * @return + */ + @GetMapping(DEPT_INFO_BY_ID) + R deptInfoById(@RequestParam("deptId") String deptId); +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/IEmployeeClient.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/IEmployeeClient.java new file mode 100644 index 0000000..a772ad7 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/feign/basic/IEmployeeClient.java @@ -0,0 +1,45 @@ +package org.security.ht.feign.basic; + +import org.security.common.constant.CommonConstant; +import org.security.ht.entity.basic.Employee; +import org.springblade.core.tool.api.R; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @author :wzf + * @apiNote :Employee Feign接口类 + * @since :Created in 2022/9/7 11:09 + */ + +@FeignClient( + value = CommonConstant.APPLICATION_SECURITY, + fallback = EmployeeClientFallback.class +) +public interface IEmployeeClient { + + String API_PREFIX = "/client"; + String EMPLOYEE_INFO = API_PREFIX + "/detail"; + String SYS_EMPLOYEE_DATA = API_PREFIX + "/syn/employee"; + String SYN_REMOVE_DATA = API_PREFIX + "/syn/remove-employee"; + + + @GetMapping(EMPLOYEE_INFO) + R getEmployeeAndFamiliesAndJobRecords(Long id); + + @PostMapping(SYS_EMPLOYEE_DATA) + R synData(@RequestBody List employees); + /** + *消息总线信息同步,删除未启用员工 + */ + @PostMapping(SYN_REMOVE_DATA) + R removeData(@RequestBody String id); + + + + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DepartmentVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DepartmentVO.java new file mode 100644 index 0000000..1aa7951 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DepartmentVO.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.vo.basic; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import org.security.ht.entity.basic.Department; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.springblade.core.tool.node.INode; + +import java.util.ArrayList; +import java.util.List; + +/** + * 基础信息-组织机构视图实体类 + * + * @author BladeX + * @since 2022-03-07 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "DepartmentVO对象", description = "基础信息-组织机构") +public class DepartmentVO extends Department implements INode { + private static final long serialVersionUID = 1L; + /** + * 主键ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + /** + * 父节点ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; + + /** + * 子孙节点 + */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + /** + * 是否有子孙节点 + */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private Boolean hasChildren; + + @Override + public List getChildren() { + if (this.children == null) { + this.children = new ArrayList<>(); + } + return this.children; + } + + /** + * 层级 + */ + private String deptLevel; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DeptDataVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DeptDataVO.java new file mode 100644 index 0000000..a819f43 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DeptDataVO.java @@ -0,0 +1,28 @@ +package org.security.ht.vo.basic; + +import lombok.Data; +import org.security.ht.entity.basic.Department; +import org.security.ht.vo.common.UploadVO; +import java.io.Serializable; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/7/4 11:13 + */ +@Data +public class DeptDataVO extends Department implements Serializable { + + /** + * 机构相关照片 + */ + private List deptDisList; + /** + * 机构证照 + */ + private List deptLicenseList; + /** + * 上级机构名称 + */ + private String parentName; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DeviceVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DeviceVO.java new file mode 100644 index 0000000..c9ac10c --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/DeviceVO.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.vo.basic; + +import org.security.ht.entity.basic.Device; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.ht.vo.common.UploadVO; + +import java.util.List; + +/** + * 基础信息-设备信息视图实体类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "DeviceVO对象", description = "基础信息-设备信息") +public class DeviceVO extends Device { + private static final long serialVersionUID = 1L; + String typeName; + List typeRankList; + List deptIdList; + /** + * 设备图片 + */ + private List picList; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/EmployeeVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/EmployeeVO.java new file mode 100644 index 0000000..99e7bf9 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/EmployeeVO.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.vo.basic; + +import org.security.ht.entity.basic.Employee; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.ht.entity.basic.Family; +import org.security.ht.entity.basic.JobRecord; +import org.security.ht.vo.common.UploadVO; + +import java.util.List; +import java.util.Map; + +/** + * 基础信息-员工视图实体类 + * + * @author BladeX + * @since 2022-03-07 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "EmployeeVO对象", description = "基础信息-员工") +public class EmployeeVO extends Employee { + private static final long serialVersionUID = 1L; + private String department;//返回前端-所属部门名称 + private String secondDepartment;//返回前端-借调部门名称 + private List families; + private List jobRecords; + private List deptList;//返回前端-所属部门级联id + private List secondDeptList;//返回前端-借调部门级联id + private List> leaderList;//机构负责人 + private List> safetyOfficerList;//安全员 + private List> leaderInChargeList;//分管领导 + + /** + * 企业工龄 + */ + private Integer seniorityInEnterprise; + + + /** + * 行内工龄 + */ + private Integer professionalLengthOfService; + + /** + * 相关附件 + */ + private List relevantAttachments; + /** + * 证件照附件 + */ + private List picList; + /** + * 身份证正面照附件 + */ + private List idCardFrontList; + /** + * 身份证反面照附件 + */ + private List idCardBackList; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/FamilyVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/FamilyVO.java new file mode 100644 index 0000000..6609af0 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/FamilyVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.vo.basic; + +import org.security.ht.entity.basic.Family; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 基础信息-员工家庭成员视图实体类 + * + * @author BladeX + * @since 2022-03-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "FamilyVO对象", description = "基础信息-员工家庭成员") +public class FamilyVO extends Family { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/JobRecordVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/JobRecordVO.java new file mode 100644 index 0000000..ebc6f0f --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/JobRecordVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.vo.basic; + +import org.security.ht.entity.basic.JobRecord; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 基础信息-员工工作履历视图实体类 + * + * @author BladeX + * @since 2022-03-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "JobRecordVO对象", description = "基础信息-员工工作履历") +public class JobRecordVO extends JobRecord { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/LawVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/LawVO.java new file mode 100644 index 0000000..8b93452 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/LawVO.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.vo.basic; + +import org.security.ht.entity.basic.Law; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.ht.vo.common.UploadVO; + +import java.util.List; + +/** + * 视图实体类 + * + * @author BladeX + * @since 2022-05-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "LawVO对象", description = "LawVO对象") +public class LawVO extends Law { + private static final long serialVersionUID = 1L; + private String deptName; + /** + * 法律法规附件 + */ + private List fileList; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/MailListVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/MailListVO.java new file mode 100644 index 0000000..ea5e7b8 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/MailListVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.vo.basic; + +import org.security.ht.entity.basic.MailList; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 基础信息-联系信息表视图实体类 + * + * @author BladeX + * @since 2022-05-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "MailListVO对象", description = "基础信息-联系信息表") +public class MailListVO extends MailList { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/MapDeptDataVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/MapDeptDataVO.java new file mode 100644 index 0000000..c0dd67f --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/MapDeptDataVO.java @@ -0,0 +1,38 @@ +package org.security.ht.vo.basic; + +import lombok.Data; + +/** + * @author Create by wzf + * @date 2022/7/29 10:54 + */ +@Data +public class MapDeptDataVO { + + /** + * 机构id + */ + private String id; + + /** + * 机构经纬度坐标 + */ + private String coordinate; + /** + * 机构经度坐标 + */ + private String longitude; + /** + * 机构纬度坐标 + */ + private String latitude; + + /** + * 机构名称 + */ + private String deptName; + /** + * 机构类别 总行 分行 支行 自助行 + */ + private String category; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/RoleDataVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/RoleDataVO.java new file mode 100644 index 0000000..d7dcc5d --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/RoleDataVO.java @@ -0,0 +1,13 @@ +package org.security.ht.vo.basic; + +import lombok.Data; + +/** + * @author Create by wzf + * @date 2022/7/18 10:50 + */ +@Data +public class RoleDataVO { + private Long id; + private String roleName; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/SelfHelpBankVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/SelfHelpBankVO.java new file mode 100644 index 0000000..df9b478 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/basic/SelfHelpBankVO.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.vo.basic; + +import org.security.ht.entity.basic.SelfHelpBank; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 基础信息-自助银行视图实体类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SelfHelpBankVO对象", description = "基础信息-自助银行") +public class SelfHelpBankVO extends SelfHelpBank { + private static final long serialVersionUID = 1L; + private String deptName; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/common/FileVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/common/FileVO.java new file mode 100644 index 0000000..fc1d9c0 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/common/FileVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.ht.vo.common; + +import org.security.ht.entity.common.File; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 公共-附件表视图实体类 + * + * @author BladeX + * @since 2022-07-04 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "FileVO对象", description = "公共-附件表") +public class FileVO extends File { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/common/UploadVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/common/UploadVO.java new file mode 100644 index 0000000..aa3ae51 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/vo/common/UploadVO.java @@ -0,0 +1,55 @@ +package org.security.ht.vo.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zj 2022/5/11 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class UploadVO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 用于表示存附件表是的标识符id + */ + private String id; + + /** + * 文件名称 + */ + private String name; + /** + * 文件类型 + */ + private String fileType; + /** + * 文件地址路由 + */ + private String url; + + private String groupType; + + private String groupName; + + /** + * 影像平台文件标识id + */ + private String contentId; + + /** + * 业务开始时间 + */ + private String busiBeginDate; + + private Boolean encrypt; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/dto/HandoverHistoryDTO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/dto/HandoverHistoryDTO.java new file mode 100644 index 0000000..4f5de61 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/dto/HandoverHistoryDTO.java @@ -0,0 +1,19 @@ +package org.security.ht.workHandOverUsers.dto; + +import lombok.Data; +import org.security.ht.vo.common.UploadVO; +import org.security.ht.workHandOverUsers.entity.HandoverHistory; + +import java.util.List; + +/** + * @author :wzf + * @since :Created in 2022/10/27 11:11 + */ +@Data +public class HandoverHistoryDTO extends HandoverHistory { + /** + * 交接照片 + */ + private List imgUrl; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/dto/WorkHandoverUsersDTO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/dto/WorkHandoverUsersDTO.java new file mode 100644 index 0000000..34872b9 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/dto/WorkHandoverUsersDTO.java @@ -0,0 +1,12 @@ +package org.security.ht.workHandOverUsers.dto; + +import lombok.Data; +import org.security.ht.workHandOverUsers.entity.WorkHandoverUsers; + +/** + * @author :wzf + * @since :Created in 2022/9/2 16:41 + */ +@Data +public class WorkHandoverUsersDTO extends WorkHandoverUsers { +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/entity/HandoverHistory.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/entity/HandoverHistory.java new file mode 100644 index 0000000..75ee713 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/entity/HandoverHistory.java @@ -0,0 +1,58 @@ +package org.security.ht.workHandOverUsers.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.entity.common.BaseEntity; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author zj 2022/9/7 + */ + +/** + * 交接流水表; + * @author : zj + * @date : 2022-9-7 + */ +@Data +@ApiModel(value = "工作交接记录表",description = "") +@TableName("T_HANDOVER_HISTORY") +public class HandoverHistory extends BaseEntity implements Serializable,Cloneable{ + /** 主键 */ + @ApiModelProperty(name = "主键",notes = "") + @TableId + private String id ; + /** 交接人 */ + @ApiModelProperty(name = "交接人",notes = "") + private String handoverFrom ; + /** 交接人身份证 */ + @ApiModelProperty(name = "交接人身份证",notes = "") + private String handoverFromIdCard ; + /** 被交接人 */ + @ApiModelProperty(name = "被交接人",notes = "") + private String handoverTo ; + /** 被交接人身份证 */ + @ApiModelProperty(name = "被交接人身份证",notes = "") + private String handoverToIdCard ; + /** 交接时间 */ + @ApiModelProperty(name = "交接时间",notes = "") + private Date handoverTime ; + /** 交接内容 */ + @ApiModelProperty(name = "交接内容",notes = "") + private String content ; + /** 交接数量 */ + @ApiModelProperty(name = "交接数量") + private String handoverCount ; + /** 交接详情 */ + @ApiModelProperty(name = "交接详情") + private String handoverDetail ; + /** 附件groupname */ + @ApiModelProperty(name = "附件groupname") + private String groupName; + +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/entity/WorkHandoverUsers.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/entity/WorkHandoverUsers.java new file mode 100644 index 0000000..80a60a3 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/entity/WorkHandoverUsers.java @@ -0,0 +1,66 @@ +package org.security.ht.workHandOverUsers.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import org.security.ht.entity.common.BaseEntity; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :工作交接用户信息 + * @since :Created in 2022/9/2 16:34 + */ +@Data +@TableName("T_WORK_HANDOVER_USERS") +public class WorkHandoverUsers extends BaseEntity implements Serializable { + + /**ID*/ + @TableField("id") + private String id; + + /**用户类型;1-行内用户,2-外包人员*/ + @TableField("user_type") + private int userType; + + /**工作类型编码*/ + @TableField("work_type_code") + private String workTypeCode; + + /**工作类型名称*/ + @TableField("work_type_name") + private String workTypeName; + + /**工作交接用户名称*/ + @TableField("user_name") + private String userName; + + /**工作交接用户身份证号*/ + @TableField("ID_card") + private String IDCard; + + /** + * 工作交接员工工号,当用户类型为行内用户时保存次字段 + * */ + @TableField("account") + private String account; + + /**机构编码*/ + @TableField("dept_id") + private String deptId; + + /**机构名称*/ + @TableField("dept_name") + private String deptName; + + /**是否存在人脸信息;0-否,1-是*/ + @TableField("face_state") + private int faceState; + + /**删除标识符;1-删除;0-正常*/ + @TableField("del_flag") + @TableLogic + private String delFlag; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/HandoverHistoryVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/HandoverHistoryVO.java new file mode 100644 index 0000000..d24eb73 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/HandoverHistoryVO.java @@ -0,0 +1,23 @@ +package org.security.ht.workHandOverUsers.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.vo.common.UploadVO; +import org.security.ht.workHandOverUsers.entity.HandoverHistory; + +import java.util.List; + +/** + * @author zj 2022/9/7 + */ +@Data +public class HandoverHistoryVO extends HandoverHistory { + /** + * 交接照片 + */ + private List imgUrl; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/WorkHandoverCheckVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/WorkHandoverCheckVO.java new file mode 100644 index 0000000..0eabd0e --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/WorkHandoverCheckVO.java @@ -0,0 +1,27 @@ +package org.security.ht.workHandOverUsers.vo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author zj 2022/9/6 + */ +@Data +public class WorkHandoverCheckVO { + // 以下验证请传空字符串 + @NotNull + private String handoverFrom; //交接人 + @NotNull + private String handoverFromIdCard; //交接人身份证 + @NotNull + private String handoverFromAcc; + private int handoverFromType; + @NotNull + private String handoverTo; //被交接人 + @NotNull + private String handoverToIdCard; //被交接人身份证 + private int handoverToType; + @NotNull + private String handoverToAcc; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/WorkHandoverUsersVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/WorkHandoverUsersVO.java new file mode 100644 index 0000000..5b73c8d --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/WorkHandoverUsersVO.java @@ -0,0 +1,17 @@ +package org.security.ht.workHandOverUsers.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.workHandOverUsers.entity.WorkHandoverUsers; + +/** + * @author :wzf + * @since :Created in 2022/9/2 16:41 + */ +@Data +public class WorkHandoverUsersVO extends WorkHandoverUsers { + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; +} diff --git a/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/deptDataVO.java b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/deptDataVO.java new file mode 100644 index 0000000..08dacb5 --- /dev/null +++ b/security-service-api/ht-security-api/src/main/java/org/security/ht/workHandOverUsers/vo/deptDataVO.java @@ -0,0 +1,18 @@ +package org.security.ht.workHandOverUsers.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :获取相关机构id和名称 + * @since :Created in 2022/10/27 14:19 + */ +@Data +public class deptDataVO implements Serializable { + + private String deptId; + + private String deptName; +} diff --git a/security-service-api/pom.xml b/security-service-api/pom.xml index 70bf7f3..868709e 100644 --- a/security-service-api/pom.xml +++ b/security-service-api/pom.xml @@ -20,7 +20,7 @@ security-scope-api security-system-api security-user-api - security-busi-api + ht-security-api diff --git a/security-service/ht-security/pom.xml b/security-service/ht-security/pom.xml new file mode 100644 index 0000000..dc95d89 --- /dev/null +++ b/security-service/ht-security/pom.xml @@ -0,0 +1,124 @@ + + + + security-service + org.security + 2.8.1.RELEASE + + 4.0.0 + + ht-security + + 3.5.1 + + + + + org.springblade + blade-core-boot + + + com.alibaba + druid-spring-boot-starter + + + com.oracle.database.jdbc + ojdbc7 + + + ojdbc7 + com.oracle + + + druid + com.alibaba + + + + + + org.springblade + blade-starter-swagger + + + org.springframework.boot + spring-boot-starter-test + + + org.security + security-system-api + 2.8.1.RELEASE + compile + + + + com.alibaba + easyexcel + 3.0.5 + + + org.springblade + blade-starter-excel + + + cn.hutool + hutool-all + 5.4.1 + + + org.security + security-user-api + 2.8.1.RELEASE + + + org.security + security-desk-api + 2.8.1.RELEASE + + + org.jsoup + jsoup + 1.11.3 + + + org.owasp.esapi + esapi + 2.1.0.1 + + + + com.google.zxing + javase + 3.0.0 + + + + com.google.zxing + core + 3.3.0 + + + org.security + security-flow-api + 2.8.1.RELEASE + compile + + + org.security + ht-security-api + ${bladex.project.version} + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + diff --git a/security-service/ht-security/src/main/java/org/security/Application.java b/security-service/ht-security/src/main/java/org/security/Application.java new file mode 100644 index 0000000..5147de3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/Application.java @@ -0,0 +1,19 @@ +package org.security; + +import org.mybatis.spring.annotation.MapperScan; +import org.security.common.constant.CommonConstant; +import org.springblade.core.launch.BladeApplication; +import org.springframework.cloud.client.SpringCloudApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * @author zj 2022/2/11 + */ +@EnableFeignClients({"org.security","org.springblade"}) +@SpringCloudApplication +@MapperScan("org.security.trans.*.mapper") +public class Application { + public static void main(String[] args) { + BladeApplication.run(CommonConstant.APPLICATION_SECURITY, Application.class, args); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/Constant.java b/security-service/ht-security/src/main/java/org/security/common/Constant.java new file mode 100644 index 0000000..791ee27 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/Constant.java @@ -0,0 +1,196 @@ +package org.security.common; + +/** + * @author zj 2022/2/23 + * 常量类 + */ +public class Constant { + public static final String FALI_MESSAGE = "系统异常,请联系管理人员"; + + public static final String DELETE_FLAG_0="0";//正常 + public static final String DELETE_FLAG_1="1";//删除 + //任务下发角度 + public static final String TASK_STATE_DRAFT="0";//任务待下发状态(初始默认状态) + public static final String TASK_STATE_PUBLISH="1";//任务已发布状态 + public static final String TASK_STATE_END="2";//任务已终止状态 + + public static final String TASK_PREFIX="TASK";//任务编号前缀 + + public static final String HANDIN_TYPE_SINGLE="single";//任务提报类型-单次 + public static final String HANDIN_TYPE_FREQ="freq";//任务提报类型-按频次 + + public static final String TASK_FLAG_USUAL="usual";//任务类型-日常任务 + public static final String TASK_FLAG_UNUSUAL="unusual";//任务类型-专项任务 + + // 提报流程状态------- + public static final String HANDIN_STATE_DRAFT="0";//任务未提交审批状态 + public static final String HANDIN_STATE_AUDIT="1";//任务审批中状态 + public static final String HANDIN_STATE_FINISH="2";//任务审批完成状态(已审批完毕,或无需审批的任务自行进行确认) + public static final String HANDIN_STATE_REFUSE="3";//任务审批驳回状态 +// 任务执行状态 + public static final String TASK_HANDIN_STATE_DRAFT="0";//待执行 + public static final String TASK_HANDIN_STATE_DRAFT_OVERTIME="1";//超时待执行 + public static final String TASK_HANDIN_STATE_SUBMIT="2";//按时已执行 + public static final String TASK_HANDIN_STATE_OVERTIME_SUBMIT="3";//超时已执行 + public static final String TASK_STOP="4";//教育培训、应急演练、案件防控任务终止 + + + + //检查整改begin----------- + public static final String INSPECTION_TYPE_SELF ="1";//自检自查,检查机构=被检查机构,都是内部机构 + public static final String INSPECTION_TYPE_IN ="2";//内部检查,检查机构≠被检查机构,都是内部机构 + public static final String INSPECTION_TYPE_OUT ="3";//外部检查,检查机构为外部单位,被检查机构为内部机构 + + public static final String PROBLEM_STATE_DRAFT="0";//待检查 + public static final String PROBLEM_STATE_DRAFT_OVERTIME="1";//超时待检查 + public static final String PROBLEM_STATE_WAIT_RECTIFY="2";//待整改;检查已提报,有问题 + public static final String PROBLEM_STATE_SUBMIT="3";//按时已整改 + public static final String PROBLEM_STATE_OVERTIME="4";//超时待整改 + public static final String PROBLEM_STATE_OVERTIME_SUBMIT="5";//超时已整改 + public static final String PROBLEM_STATE_NO_PROBLEM="6";//检查正常;检查已提报,没有问题,无需整改 + public static final String TASK_STOP_INSPECTION="7";//检查整改任务终止 + //检查整改end----------- + + // 设备使用状态begin------- + public static final String DEVICE_STATE_DUSE="0"; //未投入使用 + public static final String DEVICE_STATE_USE="1"; //正常使用 + public static final String DEVICE_STATE_OVERTIME_USE="2"; //超期使用 + public static final String DEVICE_STATE_DISPOSED="3"; //已处置 + // 设备使用状态end------- + + // 设备检查状态begin------- + public static final String DEVICE_STATE_INSPECTION="4"; //检查中 + public static final String DEVICE_STATE_INSPECTION_OVER="5"; //检查完成 + public static final String DEVICE_STATE_RECTIFY="6"; //待整改 + public static final String DEVICE_STATE_RECTIFY_OVER="7"; //整改完成 + public static final String DEVICE_STATE_OVERTIME_INSPECTION="8"; //超期未检查 + public static final String DEVICE_STATE_LEADER_CONFIRM="9"; //待领导确认 + + public static final String DEVICE_LINE_STATE_0="0"; //待检 + public static final String DEVICE_LINE_STATE_2="2"; //已检 + // 设备检查状态end------- + + public static final String PARENT_ID="0"; //父级id 机构树根节点 + + + public static final String RECTIFICATION_STATE_FAIL="0";//未整改 + public static final String RECTIFICATION_STATE_SUCCESS="1";//已整改 + + public static final String SEX_BOY="1";//男 + public static final String SEX_GIRL="2";//女 + + public static final String DEVICE_PROBLEM_NORMAL="1"; //正常 + public static final String DEVICE_PROBLEM_WARN="2"; //告警 + + public static final String APP_BACKLOG_TYPE_1 = "1";//教育培训待办信息 + public static final String APP_BACKLOG_TYPE_2 = "2";//应急演练待办信息 + public static final String APP_BACKLOG_TYPE_3 = "3";//设备检查待办信息 + public static final String APP_BACKLOG_TYPE_4 = "4";//设备整改待办信息 + public static final String APP_BACKLOG_TYPE_5 = "5";//设备持续整改代办信息 + + + public static final String USUAL_STATE_FALSE="0"; //否 + public static final String USUAL_STATE_TURE="1"; //是 + + + public static final String SUBMIT_TYPE_ZERO="0"; //暂存 + public static final String SUBMIT_TYPE_ONE="1"; //提报/警情推送 + + public static final String BUTTON_STATE_ZERO="0"; //按钮状态0 + public static final String BUTTON_STATE_ONE="1"; //按钮状态1 + public static final String BUTTON_STATE_TOW="2"; //按钮状态2 + public static final String BUTTON_STATE_THREE="3"; //按钮状态3 + + public static final String CHECK_TYPE_OUTLETS="1"; //营业网点检查 + public static final String CHECK_TYPE_SELF_BANK="2"; //自助银行检查 + + public static final String CHECK_STATUS_ZERO="0"; //营业网点或自助银行检查结果状态-异常 + public static final String CHECK_STATUS_ONE="1"; //营业网点或自助银行检查结果状态-正常 + public static final String CHECK_STATUS_TWO="2"; //营业网点或自助银行检查结果状态-已整改 + + public static final String NOTICE_TYPE_ONE="1"; //营业网点检查整改通知书 + public static final String NOTICE_TYPE_TWO="2"; //自助银行检查整改通知书 + public static final String NOTICE_TYPE_THREE="3"; //其他检查整改通知书 + + public static final String LEADER = "leader";//机构负责人 + public static final String LEADER_IN_CHARGE="leaderInCharge";//分管领导 + public static final String SAFER = "safer";//安全员 + + public static final String PUSH_STATE_ZERO="0"; //待推送 + public static final String PUSH_STATE_ONE="1"; //已推送 + public static final String PUSH_STATE_TWO="2"; //已办结/已提报 + public static final String PUSH_STATUS_ZERO="0"; //未提报 + public static final String PUSH_STATUS_ONE="1"; //按时提报 + public static final String PUSH_STATUS_TWO="2"; //超时提报 + public static final String PUSH_STATUS_THREE="3"; //超时未提报 + + public static final String ALARM_TYPE_PERSON="1"; //外侵事件 + public static final String ALARM_TYPE_DEVICE="2"; //设备报警 + public static final String ALARM_TYPE_OTHER="3"; //其他 + + public static final String MENU_TYPE_ZERO="0"; //推送警情 + public static final String MENU_TYPE_ONE="1"; //接收警情信息 + + + public static final String PROJECT_NODE_START="0"; //项目节点-开始 + public static final String PROJECT_NODE_ESTABLISHMENT="1"; //项目节点-立项 + public static final String PROJECT_NODE_PURCHASE="2"; //项目节点-采购 + public static final String PROJECT_NODE_CONTRACT="3"; //项目节点-合同 + public static final String PROJECT_NODE_IMPLEMENTATION="4"; //项目节点-实施 + public static final String PROJECT_NODE_CHECK="5"; //项目节点-验收 + public static final String PROJECT_NODE_OVER="6"; //项目节点-结项 + public static final String PROJECT_NODE_REVIEW="7"; //项目节点-审阅通过 + + + public static final String REMINDER_STATE_DRAFT="0"; //便签提醒-未提交(初始状态) + public static final String REMINDER_STATE_SUBMIT="1"; //便签提醒-已提交(提交之后,在提醒期内被提醒人可见) + public static final String REMINDER_STATE_DONE="2"; //便签提醒-已关闭(被提醒人主动关闭提醒) + public static final String REMINDER_STATE_END="3"; //便签提醒-已结束(提醒到期,自动结束) + + public static final Integer PROJECT_OVER = 1; //项目结项 + public static final Integer PROJECT_OVER_REJECT = 2; //结项驳回 + public static final Integer PROJECT_OVER_AGREE = 3; //同意结项 + + public static final String PROJECT_PAY_PLAN_ONE = "1"; //项目付款计划-质保金付款 + public static final String PROJECT_PAY_PLAN_TWO = "2"; //项目付款计划-其他付款 + public static final String PROJECT_PAY_PLAN_THREE = "3"; //项目付款计划-合同第X期 + + public static final String PROJECT_OVER_ONE = "1"; //有权限进行项目结项驳回和同意操作 + public static final String PROJECT_OVER_TWO = "2"; //无权限进行项目结项驳回和同意操作 + + public static final String PROBLEM_STATE_ZORE="0";//暂存 + public static final String PROBLEM_STATE_DRAFT_ONE="1";//待整改 + public static final String PROBLEM_STATE_WAIT_TWO="2";//按时整改 + public static final String PROBLEM_STATE_THREE="3";//超时整改 + public static final String PROBLEM_STATE_FOURE="4";//超时未整改 + public static final String PROBLEM_STATE_CONTIUE="5";//持续整改 + public static final String PROBLEM_STATE_SIX="6";//6-待安全员确认 + + + public static final String PROBLEM_STATE_USUUAL="1";//普通一次性整改记录 + public static final String PROBLEM_STATE_CONTINUED="2";//持续整改后续补充整改记录 + + public static final String FORM_STATE_DRAFT="0"; //表单或信息状态-草稿 + public static final String FORM_STATE_VALID="1"; //表单或信息状态-正式启用 + public static final String FORM_STATE_END="2"; //表单或信息状态-停用 + + public static final int WORK_HANDOVER_USER_TYPE_BANK=1; //行内用户 + public static final int WORK_HANDOVER_USER_TYPE_OUT=2; //外包用户 + + public static final String INCLUDE_CHILDREN_TYPE_ZERO = "0"; //统计机构不包含子级机构数据 + public static final String INCLUDE_CHILDREN_TYPE_ONE = "1"; //统计机构包含子级机构数据 + + public static final String EDU_DATA_TYPE = "1"; //教育培训和应急演练数据统计类型标识符-教育培训 + public static final String DRILL_DATA_TYPE = "2"; //教育培训和应急演练数据统计类型标识符-应急演练 + + public static final String ASSESSMENT_TYPE_ONE = "1"; //考核评价类型标识符-机构自评 + public static final String ASSESSMENT_TYPE_TWO = "2"; //考核评价类型标识符-行内考核 + public static final String ASSESSMENT_TYPE_THREE = "3"; //考核评价类型标识符-外部考核 + public static final String ASSESSMENT_TYPE_FOUR = "4"; //考核评价类型标识符-外包公司考核 + public static final String ASSESSMENT_TYPE_FIVE = "5"; //考核评价类型标识符-项目考核 + + public static final String STATISTICS_ASSESSMENT_TYPE_ONE = "1"; //考核评价数据统计类型标识符-机构考核统计 + public static final String STATISTICS_ASSESSMENT_TYPE_TWO = "2"; //考核评价数据统计类型标识符-相关方考核统计 + public static final String STATISTICS_ASSESSMENT_TYPE_THREE = "3"; //考核评价数据统计类型标识符-项目考核统计 + +} diff --git a/security-service/ht-security/src/main/java/org/security/common/business/BusinessController.java b/security-service/ht-security/src/main/java/org/security/common/business/BusinessController.java new file mode 100644 index 0000000..3226132 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/business/BusinessController.java @@ -0,0 +1,39 @@ +package org.security.common.business; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.projectBudgetManagement.service.IBudgetItemService; +import org.security.trans.projectBudgetManagement.vo.DictDataVO; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * @author Create by wzf + * @date 2022/3/15 15:55 + * 公共业务接口 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/business") +public class BusinessController { + + private final IBudgetItemService budgetItemService; + + /** + * 根据字典主键获取字典信息 + */ + + @GetMapping("/dict") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "获取相关字典信息", notes = "传入字典编码keyName") + public R> getDictData (@RequestParam String keyName){ + return R.data(budgetItemService.getDictData(keyName)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/config/AppOauth2Propertis.java b/security-service/ht-security/src/main/java/org/security/common/config/AppOauth2Propertis.java new file mode 100644 index 0000000..99eb873 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/config/AppOauth2Propertis.java @@ -0,0 +1,20 @@ +package org.security.common.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * @author zj 2022/6/27 + */ +@Data +@Component +@ConfigurationProperties(prefix = "app-oauth") +public class AppOauth2Propertis { + + private String accessTokenUrl; + private String userContextUrl; + private String appIndexUrl; + private String appId; + private String secret; +} diff --git a/security-service/ht-security/src/main/java/org/security/common/config/CommonProperties.java b/security-service/ht-security/src/main/java/org/security/common/config/CommonProperties.java new file mode 100644 index 0000000..dfbff9c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/config/CommonProperties.java @@ -0,0 +1,22 @@ +package org.security.common.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * @author :wzf + * @apiNote :公共配置参数 + * @since :Created in 2022/9/20 9:13 + */ +@Data +@Component +@ConfigurationProperties(prefix = "common") +public class CommonProperties { + + private String projectRoleName; + private String securityRoleName; + private String payPlanRemindKeyName; + private String concatDeadlineRemindKeyName; + private String servicePath; +} diff --git a/security-service/ht-security/src/main/java/org/security/common/config/FeignConfiguration.java b/security-service/ht-security/src/main/java/org/security/common/config/FeignConfiguration.java new file mode 100644 index 0000000..f9f81f3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/config/FeignConfiguration.java @@ -0,0 +1,13 @@ +package org.security.common.config; + +import feign.RequestInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FeignConfiguration { + @Bean + public RequestInterceptor requestInterceptor() { + return new FeignClientRequestInterceptor(); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/config/ScheduledTaskProperties.java b/security-service/ht-security/src/main/java/org/security/common/config/ScheduledTaskProperties.java new file mode 100644 index 0000000..6682ecc --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/config/ScheduledTaskProperties.java @@ -0,0 +1,64 @@ +package org.security.common.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 定时任务相关参数 + * @author nantian.yangzhengyu + * @date 2024/1/11 14:59 + */ +@Data +@Component +@ConfigurationProperties(prefix = "schedule") +public class ScheduledTaskProperties { + /** + *测试 + */ + public String testCron; + /** + *【定时任务】自动生成设备检查任务 + */ + private String deviceInspectionCron; + /** + *【定时任务】设备类型变更关联设备检查对应字段变更 + */ + private String deviceCatgChangeCron; + /** + *【定时任务】设备检查是否超时 + */ + private String deviceInspOvertimeCron; + /** + *【定时任务】检查设备是否超维保期限使用 + */ + private String deviceOvertimeCron; + /** + *【定时任务】检测提报任务是否超时 + */ + private String taskOvertimeCron; + /** + *【定时任务】任务发布 + */ + private String taskPublishCron; + /** + *【定时任务】任务到期终止 + */ + private String taskExpireCron; + /** + *【定时任务】检查禁用后重启用的员工并重启用 + */ + private String reEnableEmplyeeCron; + /** + *【定时任务】检查禁用后重启用的机构并重启用 + */ + private String reEnableDeptCron; + /** + *【定时任务】检查工作提醒是否超过提醒结束日期 + */ + private String remindNoteOvertimeCron; + /** + *【定时任务】触发手动同步机构员工 + */ + private String syncEmpDeptCron; +} diff --git a/security-service/ht-security/src/main/java/org/security/common/config/ThreadPoolConfig.java b/security-service/ht-security/src/main/java/org/security/common/config/ThreadPoolConfig.java new file mode 100644 index 0000000..51bc351 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/config/ThreadPoolConfig.java @@ -0,0 +1,26 @@ +package org.security.common.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.ThreadPoolExecutor; + +/** + * @author zj 2022/4/27 + * 业务线程池配置 + */ +@Configuration +public class ThreadPoolConfig { + + @Bean + public ThreadPoolTaskExecutor securityThreadPool() { + ThreadPoolTaskExecutor poolTaskExecutor = new ThreadPoolTaskExecutor(); + poolTaskExecutor.setCorePoolSize(Runtime.getRuntime().availableProcessors()); + poolTaskExecutor.setMaxPoolSize(1000); + poolTaskExecutor.setKeepAliveSeconds(60 * 3); + poolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + poolTaskExecutor.setThreadNamePrefix("security-htread-"); + return poolTaskExecutor; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/eum/AssessmentYearEnum.java b/security-service/ht-security/src/main/java/org/security/common/eum/AssessmentYearEnum.java new file mode 100644 index 0000000..0e9d274 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/eum/AssessmentYearEnum.java @@ -0,0 +1,65 @@ +package org.security.common.eum; + +/** + * @author Create by wzf + * @date 2022/3/25 10:11 + * 考核年度枚举 + */ +public enum AssessmentYearEnum { + /** + * 考核年度枚举 + */ + ONE("1","年度"), + TWO("2","半年"), + THREE("3","季度"), + FOUR("4","月份"), + + UNKNOWN("-1","unknown"); + + private String code; + + private String label; + + AssessmentYearEnum(String code, String label) { + this.code = code; + this.label = label; + } + + public String getCode() { + return code; + } + + public String getLabel() { + return label; + } + + /** + * + * @param code + * @return + */ + public static AssessmentYearEnum parseByCode(String code) { + AssessmentYearEnum[] items = AssessmentYearEnum.values(); + for (AssessmentYearEnum item : items) { + if (item.code.equals(code)) { + return item; + } + } + return UNKNOWN; + } + + /** + * + * @param label + * @return + */ + public static AssessmentYearEnum parseByLabel(String label) { + AssessmentYearEnum[] items = AssessmentYearEnum.values(); + for (AssessmentYearEnum item : items) { + if (item.label.equalsIgnoreCase(label)) { + return item; + } + } + return UNKNOWN; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/eum/EducationEnum.java b/security-service/ht-security/src/main/java/org/security/common/eum/EducationEnum.java new file mode 100644 index 0000000..1c32fcf --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/eum/EducationEnum.java @@ -0,0 +1,84 @@ +package org.security.common.eum; + +/** + * @author Create by wzf + * @date 2022/5/23 15:46 + */ +public enum EducationEnum { + + /** + * 员工学历、岗位类型、政治面貌枚举 + */ + ONE("specialty","专科"), + TWO("undergraduate","本科"), + THREE("master","硕士研究生"), + FOUR("doctor","博士研究生"), + FIVE("post-doctoral","博士后"), + SIX("other","其他"), + SEVEN("leader","机构负责人"), + EIGHT("safeLeader","安全部门负责人"), + NINE("leaderInCharge","分管领导"), + TEN("safer","安全员"), + ELEVEN("fireman","义务消防员"), + UNKNOWN("-1","未知"), + POLITICS_ONE("01","中共党员"), + POLITICS_TWO("02","中共预备党员"), + POLITICS_THREE("03","共青团团员"), + POLITICS_FOUR("04","民革党员"), + POLITICS_FIVE("05","民盟盟员"), + POLITICS_SIX("06","民建会员"), + POLITICS_SEVEN("07","民进会员"), + POLITICS_EIGHT("08","农工党党员"), + POLITICS_NINE("09","致公党党员"), + POLITICS_TEN("10","九三学社社员"), + POLITICS_ELEVEN("11","台盟盟员"), + POLITICS_TWELVE("12","无党派人士"), + POLITICS_THIRTEEN("13","群众"); + + private String code; + + private String label; + + EducationEnum(String code, String label) { + this.code = code; + this.label = label; + } + + public String getCode() { + return code; + } + + public String getLabel() { + return label; + } + + /** + * + * @param code + * @return + */ + public static EducationEnum parseByCode(String code) { + EducationEnum[] items = EducationEnum.values(); + for (EducationEnum item : items) { + if (item.code.equals(code)) { + return item; + } + } + return UNKNOWN; + } + + /** + * + * @param label + * @return + */ + public static EducationEnum parseByLabel(String label) { + EducationEnum[] items = EducationEnum.values(); + for (EducationEnum item : items) { + if (item.label.equalsIgnoreCase(label)) { + return item; + } + } + return UNKNOWN; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/eum/FrequencyEnum.java b/security-service/ht-security/src/main/java/org/security/common/eum/FrequencyEnum.java new file mode 100644 index 0000000..0d0d59e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/eum/FrequencyEnum.java @@ -0,0 +1,60 @@ +package org.security.common.eum; + +/** + * @author zj 2022/4/11 + * 检查类型枚举 + */ +public enum FrequencyEnum { + /** + * 按天 + */ + BY_DAY("byDay"), + /** + * 按周 + */ + BY_WEEK("byWeek"), + /** + * 按月 + */ + BY_MONTH("byMonth"), + /** + * 按季度 + */ + BY_QUARTER("byQuarter"), + /** + * 按半年 + */ + BY_HALFYEAR("byHalfYear"), + /** + * 按年 + */ + BY_YEAR("byYear"), + /** + * 未知 + */ + UNKNOW(""); + + private String type; + + FrequencyEnum(String type) { + this.type = type; + } + + public static FrequencyEnum wrapper(String type) { + FrequencyEnum[] values = FrequencyEnum.values(); + for (FrequencyEnum frequencyEnum : values) { + if (frequencyEnum.type.equals(type)) { + return frequencyEnum; + } + } + return UNKNOW; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/eum/OtherDataEnum.java b/security-service/ht-security/src/main/java/org/security/common/eum/OtherDataEnum.java new file mode 100644 index 0000000..f0a80c7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/eum/OtherDataEnum.java @@ -0,0 +1,63 @@ +package org.security.common.eum; + +/** + * @author Create by wzf + * @date 2022/6/10 16:10 + */ +public enum OtherDataEnum { + + /** + * 是否存在问题 + */ + ZERO("0","否"), + ONE("1","是"), + + UNKNOWN("-1","unknown"); + + private String code; + + private String label; + + OtherDataEnum(String code, String label) { + this.code = code; + this.label = label; + } + + public String getCode() { + return code; + } + + public String getLabel() { + return label; + } + + /** + * + * @param code + * @return + */ + public static OtherDataEnum parseByCode(String code) { + OtherDataEnum[] items = OtherDataEnum.values(); + for (OtherDataEnum item : items) { + if (item.code.equals(code)) { + return item; + } + } + return UNKNOWN; + } + + /** + * + * @param label + * @return + */ + public static OtherDataEnum parseByLabel(String label) { + OtherDataEnum[] items = OtherDataEnum.values(); + for (OtherDataEnum item : items) { + if (item.label.equalsIgnoreCase(label)) { + return item; + } + } + return UNKNOWN; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/eum/ProjectNodeEnum.java b/security-service/ht-security/src/main/java/org/security/common/eum/ProjectNodeEnum.java new file mode 100644 index 0000000..cf53d73 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/eum/ProjectNodeEnum.java @@ -0,0 +1,69 @@ +package org.security.common.eum; + +/** + * @author :wzf + * @apiNote :项目节点枚举 + * @since :Created in 2022/12/2 17:40 + */ +public enum ProjectNodeEnum { + + /** + * 项目节点 0-开始,1-立项,2-采购,3-合同,4-实施,5-验收,6-结项,7-审阅通过 + */ + ZERO(0,"项目开始"), + ONE(1,"项目立项"), + TWO(2,"项目采购"), + THREE(3,"项目合同"), + FOUR(4,"项目实施"), + FIVE(5,"项目验收"), + SIX(6,"项目结项"), + SEVEN(7,"项目审阅通过"), + UNKNOWN(-1,"UNKNOWN"); + + private int code; + + private String label; + + ProjectNodeEnum(int code, String label) { + this.code = code; + this.label = label; + } + + public int getCode() { + return code; + } + + public String getLabel() { + return label; + } + + /** + * + * @param code + * @return + */ + public static ProjectNodeEnum parseByCode(int code) { + ProjectNodeEnum[] items = ProjectNodeEnum.values(); + for (ProjectNodeEnum item : items) { + if (item.code == code) { + return item; + } + } + return UNKNOWN; + } + + /** + * + * @param label + * @return + */ + public static ProjectNodeEnum parseByLabel(String label) { + ProjectNodeEnum[] items = ProjectNodeEnum.values(); + for (ProjectNodeEnum item : items) { + if (item.label.equalsIgnoreCase(label)) { + return item; + } + } + return UNKNOWN; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/eum/TaskBusinessTypeEnum.java b/security-service/ht-security/src/main/java/org/security/common/eum/TaskBusinessTypeEnum.java new file mode 100644 index 0000000..f9301dc --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/eum/TaskBusinessTypeEnum.java @@ -0,0 +1,92 @@ +package org.security.common.eum; + +/** + * @author zj 2022/4/13 + */ +public enum TaskBusinessTypeEnum { + /** + * 检查整改 + */ + DAILY_SAFE_INSPECTION("daily_safe_inspection", "日常安全检查"), + DAILY_FIRE_PATROL("daily_fire_patrol", "每日防火巡查记录表"), + MONTH_FIREPROOF_INSPECTION_RECORD("month_fireproof_inspection_record", "每月防火检查记录表"), + WARNING_TEST_RECORD("warning_test_record", "报警系统测试情况"), + SELF_HELP_DEVICE_CHECK("self_help_device_check", "自助设备检查"), + DAILY_SPECIAL("daily_special", "检查整改专项工作"), + /** + * 安保指挥中心 + */ + SAFE_SELF_CHECK("off_site_inspection_records", "非现场检查整改通知书"), + BUSINESS_OUTLET_INSPECTION_RECORD("business_outlet_inspection_record", "营业网点检查日志"), + SELF_BANK_INSPECTION_RECORD("self_bank_inspection_record", "自助银行检查日志"), + CONTACT_ALARM_RECORD("contact_alarm_record", "联系(接警)记录"), + ALARM_PUSH("alarm_push", "警情推送"), + /** + * 申请及报备 + */ + DUTY("duty", "值班备勤"), + WORK_OVERTIME("work_overtime", "加班报备"), + + /** + * 教育培训 + */ + SAFE_MEETING("safe_meeting", "安全防范学习会议记录"), + SAFE_KNOWLEDGE("safe_knowledge", "安全知识培训情况记录"), + EDU_SPECIAL("edu_special", "教育培训专项工作"), + FIRE_PREVENTION_RECORD("fire_prevention_record", "消防宣传教育记录表"), + /** + * 应急演练 + */ + DRILL_FILE_CONTROL("drill_fire_control", "消防演练"), + DRILL_SAFETY("drill_safety", "安防演练"), + DIRLL_SPECIAL("dirll_special", "应急演练专项任务"), + /** + * 案件防控 + */ + ABNORMAL_EVENT("abnormal_event", "异常事件上报"), + PREVENT_SPECIAL("prevent_special", "处置情况上报"), + BIG_ISSUE("big_issue", "重大事项报告"), + RISK_REMINDER("risk_reminder", "风险提示"), + /** + * 设备检查 + */ + DEVICE_CHECK("device_check","设备检查"), + DEVICE_RECTIFY("device_rectify","设备整改"), + DEVICE_CONTINUED_RECTIFY("device_continued_rectify","设备持续整改"), + + UNKONOW("", "未知"); + + private String type; + private String name; + + TaskBusinessTypeEnum(String type, String name) { + this.type = type; + this.name = name; + } + + public static String convertToName(String type) { + TaskBusinessTypeEnum[] taskBusinessTypeEnums = TaskBusinessTypeEnum.values(); + for (TaskBusinessTypeEnum typeEnum : taskBusinessTypeEnums) { + if (typeEnum.getType().equals(type)) { + return typeEnum.getName(); + } + } + return UNKONOW.getName(); + } + + public String getType() { + return type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/eum/TaskHandInEnum.java b/security-service/ht-security/src/main/java/org/security/common/eum/TaskHandInEnum.java new file mode 100644 index 0000000..8f651d8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/eum/TaskHandInEnum.java @@ -0,0 +1,38 @@ +package org.security.common.eum; + +/** + * @author zj 2022/4/12 + * 任务提报状态 + */ +public enum TaskHandInEnum { + /** + * 未填报 + */ + NO_SUBMIT("0"), + /** + * 按时填报 + */ + SUBMIT("1"), + /** + * 超时填报 + */ + TIME_OUT_SUBMIT("2"), + /** + * 超时未报 + */ + TIME_OUT_NO_SUBMIT("3"); + + private String type; + + TaskHandInEnum(String type) { + this.type = type; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/eum/evaluationTimeIntervalEnum.java b/security-service/ht-security/src/main/java/org/security/common/eum/evaluationTimeIntervalEnum.java new file mode 100644 index 0000000..5080c31 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/eum/evaluationTimeIntervalEnum.java @@ -0,0 +1,81 @@ +package org.security.common.eum; + +/** + * @author Create by wzf + * @date 2022/3/25 10:37 + * 考核时段枚举 + */ +public enum evaluationTimeIntervalEnum { + + + /** + * 考核年度枚举 + */ + ONE("13","上半年"), + TWO("14","下半年"), + THREE("15","第一季度"), + FOUR("16","第二季度"), + FIVE("17","第三季度"), + SIX("18","第四季度"), + SEVEN("01","1月"), + EIGHT("02","2月"), + NIGHT("03","3月"), + TEN("04","4月"), + ELEVEN("05","5月"), + TWELVE("06","6月"), + THIRTEEN("07","7月"), + FOURTEEN("08","8月"), + FIFTEEN("09","8月"), + SIXTEEN("10","10月"), + SEVENTEEN("11","11月"), + EIGHTEEN("12","12月"), + NINETEEN("19","年度考核"), + UNKNOWN("-1","年度考核"); + + private String code; + + private String label; + + evaluationTimeIntervalEnum(String code, String label) { + this.code = code; + this.label = label; + } + + public String getCode() { + return code; + } + + public String getLabel() { + return label; + } + + /** + * + * @param code + * @return + */ + public static evaluationTimeIntervalEnum parseByCode(String code) { + evaluationTimeIntervalEnum[] items = evaluationTimeIntervalEnum.values(); + for (evaluationTimeIntervalEnum item : items) { + if (item.code.equals(code)) { + return item; + } + } + return UNKNOWN; + } + + /** + * + * @param label + * @return + */ + public static evaluationTimeIntervalEnum parseByLabel(String label) { + evaluationTimeIntervalEnum[] items = evaluationTimeIntervalEnum.values(); + for (evaluationTimeIntervalEnum item : items) { + if (item.label.equalsIgnoreCase(label)) { + return item; + } + } + return UNKNOWN; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/exception/ErrorCode.java b/security-service/ht-security/src/main/java/org/security/common/exception/ErrorCode.java new file mode 100644 index 0000000..caf0826 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/exception/ErrorCode.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) cn-fanya All rights reserved. + * + * + * + * + */ + +package org.security.common.exception; + +/** + * 错误编码,由5位数字组成,前2位为模块编码,后3位为业务编码 + *

+ * 如:10001(10代表系统模块,001代表业务代码) + *

+ * + * @author zj + * @since 1.0.0 + */ +public interface ErrorCode { + int INTERNAL_SERVER_ERROR = 500; + int UNAUTHORIZED = 401; + int FORBIDDEN = 403; + + int NOT_NULL = 10001; + int DB_RECORD_EXISTS = 10002; + int PARAMS_GET_ERROR = 10003; + int ACCOUNT_PASSWORD_ERROR = 10004; + int ACCOUNT_DISABLE = 10005; + int IDENTIFIER_NOT_NULL = 10006; + int CAPTCHA_ERROR = 10007; + int SUB_MENU_EXIST = 10008; + int PASSWORD_ERROR = 10009; + int ACCOUNT_NOT_EXIST = 10010; + int SUPERIOR_DEPT_ERROR = 10011; + int SUPERIOR_MENU_ERROR = 10012; + int DATA_SCOPE_PARAMS_ERROR = 10013; + int DEPT_SUB_DELETE_ERROR = 10014; + int DEPT_USER_DELETE_ERROR = 10015; + int ACT_DEPLOY_ERROR = 10016; + int ACT_MODEL_IMG_ERROR = 10017; + int ACT_MODEL_EXPORT_ERROR = 10018; + int UPLOAD_FILE_EMPTY = 10019; + int TOKEN_NOT_EMPTY = 10020; + int TOKEN_INVALID = 10021; + int ACCOUNT_LOCK = 10022; + int ACT_DEPLOY_FORMAT_ERROR = 10023; + int OSS_UPLOAD_FILE_ERROR = 10024; + int SEND_SMS_ERROR = 10025; + int MAIL_TEMPLATE_NOT_EXISTS = 10026; + int REDIS_ERROR = 10027; + int JOB_ERROR = 10028; + int INVALID_SYMBOL = 10029; + int JSON_FORMAT_ERROR = 10030; + int SMS_CONFIG = 10031; + int MSG_GET_VERIFY_CODE = 10032; + int MENU_TYPE_NOT_EXIST = 10033;//菜单类型不存在 + +} diff --git a/security-service/ht-security/src/main/java/org/security/common/exception/ExceptionUtils.java b/security-service/ht-security/src/main/java/org/security/common/exception/ExceptionUtils.java new file mode 100644 index 0000000..94a80ba --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/exception/ExceptionUtils.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) cn-fanya All rights reserved. + * + * + * + * + */ + +package org.security.common.exception; + +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; + +/** + * Exception工具类 + * + * @author zj + */ +public class ExceptionUtils { + + /** + * 获取异常信息 + * @param ex 异常 + * @return 返回异常信息 + */ + public static String getErrorStackTrace(Exception ex){ + StringWriter sw = null; + PrintWriter pw = null; + try { + sw = new StringWriter(); + pw = new PrintWriter(sw, true); + ex.printStackTrace(pw); + }finally { + try { + if(pw != null) { + pw.close(); + } + } catch (Exception e) { + + } + try { + if(sw != null) { + sw.close(); + } + } catch (IOException e) { + + } + } + + return sw.toString(); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/exception/RenException.java b/security-service/ht-security/src/main/java/org/security/common/exception/RenException.java new file mode 100644 index 0000000..1ab9c47 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/exception/RenException.java @@ -0,0 +1,49 @@ + +package org.security.common.exception; + +/** + * 自定义异常 + * + * @author zj + */ +public class RenException extends RuntimeException { + private static final long serialVersionUID = 1L; + + private int code; + private String msg; + + public RenException(int code, String msg) { + super(msg); + this.code = code; + this.msg = msg; + } + + public RenException(String msg) { + super(msg); + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = msg; + } + + public RenException(String msg, Throwable e) { + super(msg, e); + this.code = ErrorCode.INTERNAL_SERVER_ERROR; + this.msg = msg; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/common/exception/RenExceptionHandler.java b/security-service/ht-security/src/main/java/org/security/common/exception/RenExceptionHandler.java new file mode 100644 index 0000000..af38bd7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/exception/RenExceptionHandler.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) cn-fanya All rights reserved. + */ + +package org.security.common.exception; + +import org.security.common.Constant; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + + +/** + * 异常处理器 + * + * @author + * @since 1.0.0 + */ +@RestControllerAdvice +public class RenExceptionHandler { + private static final Logger logger = LoggerFactory.getLogger(RenExceptionHandler.class); + + + /** + * 处理自定义异常 + */ + @ExceptionHandler(RenException.class) + public R handleRenException(RenException ex) { + logger.error(ex.getMsg()); + return R.fail(ex.getCode(), ex.getMsg()); + } + + /** + * 避免异常信息返回前端 + * 22-12-28 异常传回前端以便定位问题 + * @param e + * @return + */ + @ExceptionHandler(Exception.class) + public R hendleException(Exception e) { + logger.error("系统异常:", e); + return R.fail("系统异常:" + e.getMessage()); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/handler/CustomCellWriteHandler.java b/security-service/ht-security/src/main/java/org/security/common/handler/CustomCellWriteHandler.java new file mode 100644 index 0000000..8a23ae8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/handler/CustomCellWriteHandler.java @@ -0,0 +1,101 @@ +package org.security.common.handler; + +import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.write.handler.CellWriteHandler; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; +import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; +import com.alibaba.excel.write.metadata.holder.WriteTableHolder; +import org.apache.poi.common.usermodel.HyperlinkType; +import org.apache.poi.ss.usermodel.*; + +import java.util.HashMap; +import java.util.List; + + +/** + * @author Create by wzf + * @date 2022/5/30 14:46 + * 实现CellWriteHandler接口, 实现对单元格样式的精确控制 + */ +public class CustomCellWriteHandler implements CellWriteHandler { + /** + * 在创建单元格之前调用 + */ + @Override + public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, + Head head, Integer columnIndex, Integer relativeRowIndex, Boolean isHead) { + + } + + /** + * 单元格创建之后(没有写入值) + * + * @param writeSheetHolder + * @param writeTableHolder + * @param cell + * @param head + * @param relativeRowIndex + * @param isHead + */ + @Override + public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, + Head head, Integer relativeRowIndex, Boolean isHead) { + + } + + @Override + public void afterCellDataConverted(CellWriteHandlerContext context) { + + } + + /** + * 单元格处理后(已写入值): 设置第一行第一列的头超链接到EasyExcel的官网(本系统的导出的excel 0,1两行都是头,所以只设置第一行的超链接) + * 这里再进行拦截的单元格样式设置的话,前面该样式将全部失效 + * + * @param context + */ + @Override + public void afterCellDispose(CellWriteHandlerContext context) { + // 设置超链接 + if (Boolean.TRUE.equals(context.getHead() && context.getCell().getRowIndex() == 0) && context.getCell().getColumnIndex() == 0) { + CreationHelper helper = context.getWriteSheetHolder().getSheet().getWorkbook().getCreationHelper(); + Hyperlink hyperlink = helper.createHyperlink(HyperlinkType.URL); + hyperlink.setAddress("https://github.com/alibaba/easyexcel"); + context.getCell().setHyperlink(hyperlink); + } + // 精确设置单元格格式 + boolean bool = context.getHead() && context.getCell().getRowIndex() == 1 && + ("请求参数".equals(context.getCell().getStringCellValue()) || "请求Body".equals(context.getCell().getStringCellValue())); + if (bool) { + // 获取工作簿 + Workbook workbook = context.getWriteSheetHolder().getSheet().getWorkbook(); + CellStyle cellStyle = workbook.createCellStyle(); + + Font cellFont = workbook.createFont(); + cellFont.setBold(Boolean.TRUE); + cellFont.setFontHeightInPoints((short) 14); + cellFont.setColor(IndexedColors.SEA_GREEN.getIndex()); + cellStyle.setFont(cellFont); + context.getCell().setCellStyle(cellStyle); + } + } + + /** * map + * key:第i行 + * value:第i行中单元格索引集合 + */ + private HashMap> map; + /** + * 颜色 + */ + private Short colorIndex; + /** + * 有参构造 + */ + public CustomCellWriteHandler(HashMap> map, Short colorIndex) { this.map = map; this.colorIndex = colorIndex; } + /** + * 无参构造 + */ + public CustomCellWriteHandler() { } + +} diff --git a/security-service/ht-security/src/main/java/org/security/common/handler/SecurityMetaObjectHandler.java b/security-service/ht-security/src/main/java/org/security/common/handler/SecurityMetaObjectHandler.java new file mode 100644 index 0000000..d553193 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/handler/SecurityMetaObjectHandler.java @@ -0,0 +1,34 @@ +package org.security.common.handler; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.reflection.MetaObject; +import org.springblade.core.secure.utils.AuthUtil; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Optional; + +@Slf4j +@Component +public class SecurityMetaObjectHandler implements MetaObjectHandler { + + //插入时的填充策略 + @Override + public void insertFill(MetaObject metaObject) { + + this.setFieldValByName("createdBy", Optional.ofNullable(String.valueOf(AuthUtil.getUserId())).orElse(""), metaObject); + this.setFieldValByName("updatedBy", Optional.ofNullable(String.valueOf(AuthUtil.getUserId())).orElse(""), metaObject); + this.setFieldValByName("createdTime", new Date(), metaObject); + this.setFieldValByName("updatedTime", new Date(), metaObject); + } + + //更新时的填充策略 + @Override + public void updateFill(MetaObject metaObject) { + + this.setFieldValByName("updatedTime", new Date(), metaObject); + this.setFieldValByName("updatedBy", Optional.ofNullable(String.valueOf(AuthUtil.getUserId())).orElse(""), metaObject); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/util/DataFormatUtil.java b/security-service/ht-security/src/main/java/org/security/common/util/DataFormatUtil.java new file mode 100644 index 0000000..9b4ea6e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/util/DataFormatUtil.java @@ -0,0 +1,27 @@ +package org.security.common.util; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @author Create by wzf + * @date 2022/3/7 14:04 + */ +public class DataFormatUtil { + public static Date getNowDate() throws ParseException { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return dateFormat.parse(dateFormat.format(new Date())); + } + + + public static String getDate(){ + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + return dateFormat.format(new Date()); + } + + public static Date getLocalDate() throws ParseException { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + return dateFormat.parse(dateFormat.format(new Date())); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/util/DeadlineUtil.java b/security-service/ht-security/src/main/java/org/security/common/util/DeadlineUtil.java new file mode 100644 index 0000000..af265ef --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/util/DeadlineUtil.java @@ -0,0 +1,122 @@ +package org.security.common.util; + +import org.apache.commons.lang.time.DateFormatUtils; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + * @author Created by yzy + * @date 2022/3/21 11:50 + */ +public class DeadlineUtil { + public static String getDDLByFreq(String freq, Date endDate) { + //当前日期 + Calendar c = Calendar.getInstance(); + int year = c.get(Calendar.YEAR); + int month = c.get(Calendar.MONTH); + int day = c.get(Calendar.DATE); + int weekday = c.get(Calendar.DAY_OF_WEEK); + // 按天,取当日日期 + if ("byDay".equals(freq)) { + SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd"); + String date = ft.format(new Date()); + return date; + } + // 按周,获取当周最后一天 + else if ("byWeek".equals(freq)) { + Calendar c1 = Calendar.getInstance(); +// 如果日历每周第一天是周天,需要改为每周第一天是周一的逻辑 + boolean isFirstSunday = (c.getFirstDayOfWeek() == Calendar.SUNDAY); + if(isFirstSunday){ + weekday=weekday-1; + } + int count = 7 - weekday; + c1.add(Calendar.DATE, count); + String date = DateFormatUtils.format(c1.getTimeInMillis(), "yyyy-MM-dd"); + return date; + } + // 按月,获取当月最后一天 + else if ("byMonth".equals(freq)) { + Calendar c2 = Calendar.getInstance(); + c2.set(Calendar.YEAR, year); + c2.set(Calendar.MONTH, month + 1); + int maxDay = c2.getActualMaximum(Calendar.DAY_OF_MONTH); + c2.set(Calendar.DAY_OF_MONTH, maxDay); + String date = DateFormatUtils.format(c2.getTimeInMillis(), "yyyy-MM-dd"); + return date; + } + // 按季度,获取该季度最后一天 + else if ("byQuarter".equals(freq)) { + Calendar c3 = getQuarterEnd(c); + String date = DateFormatUtils.format(c3.getTimeInMillis(), "yyyy-MM-dd"); + return date; + } + // 按半年,获取所处上/下半年的最后一天 + else if ("byHalfYear".equals(freq)) { + Calendar c4 = getHalfYearEnd(c); + String date = DateFormatUtils.format(c4.getTimeInMillis(), "yyyy-MM-dd"); + return date; + } + // 按年,取当前年度最后一天 + else if ("byYear".equals(freq)) { + Calendar c5 = Calendar.getInstance(); + c5.set(Calendar.YEAR, year); + c5.set(Calendar.MONTH, 11); + c5.set(Calendar.DAY_OF_MONTH, 31); + String date = DateFormatUtils.format(c5.getTimeInMillis(), "yyyy-MM-dd"); + return date; + } + // 单次提报,直接返回endDate + return Func.isNotEmpty(endDate) ? DateUtil.formatDate(endDate) : null; + } + + //传入日期,判断属于第几季度,并返回该季度最后一天 + public static Calendar getQuarterEnd(Calendar c) { + Calendar c1 = Calendar.getInstance(); + c1.set(c.get(Calendar.YEAR), Calendar.JANUARY, 1); + Calendar c3 = Calendar.getInstance(); + c3.set(c.get(Calendar.YEAR), Calendar.MARCH, 31); + Calendar c4 = Calendar.getInstance(); + c4.set(c.get(Calendar.YEAR), Calendar.APRIL, 1); + Calendar c6 = Calendar.getInstance(); + c6.set(c.get(Calendar.YEAR), Calendar.JUNE, 30); + Calendar c7 = Calendar.getInstance(); + c7.set(c.get(Calendar.YEAR), Calendar.JULY, 1); + Calendar c9 = Calendar.getInstance(); + c9.set(c.get(Calendar.YEAR), Calendar.SEPTEMBER, 30); + Calendar c10 = Calendar.getInstance(); + c10.set(c.get(Calendar.YEAR), Calendar.OCTOBER, 1); + Calendar c12 = Calendar.getInstance(); + c12.set(c.get(Calendar.YEAR), Calendar.DECEMBER, 31); + if (c.compareTo(c1) >= 0 && c.compareTo(c3) <= 0) {//一季度 + return c3; + } else if (c.compareTo(c4) >= 0 && c.compareTo(c6) <= 0) {//二季度 + return c6; + } else if (c.compareTo(c7) >= 0 && c.compareTo(c9) <= 0) {//三季度 + return c9; + } else {//四季度 + return c12; + } + } + + //传入日期,判断属于上半年或下半年,并返回该半年度最后一天 + public static Calendar getHalfYearEnd(Calendar c) { + Calendar c1 = Calendar.getInstance(); + c1.set(c.get(Calendar.YEAR), Calendar.JANUARY, 1); + Calendar c6 = Calendar.getInstance(); + c6.set(c.get(Calendar.YEAR), Calendar.JUNE, 30); + Calendar c7 = Calendar.getInstance(); + c7.set(c.get(Calendar.YEAR), Calendar.JULY, 1); + Calendar c12 = Calendar.getInstance(); + c12.set(c.get(Calendar.YEAR), Calendar.DECEMBER, 31); + if (c.compareTo(c1) >= 0 && c.compareTo(c6) <= 0) {//上半年 + return c6; + } else {//下半年 + return c12; + } + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/util/DocumentNumberUtil.java b/security-service/ht-security/src/main/java/org/security/common/util/DocumentNumberUtil.java new file mode 100644 index 0000000..15c7fde --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/util/DocumentNumberUtil.java @@ -0,0 +1,21 @@ +package org.security.common.util; + +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @author Create by wzf + * @date 2022/7/8 17:03 + * 生成非现场检查整改通知书文号 + */ +public class DocumentNumberUtil { + + public static String createdDocumentNumber(){ + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + String format = dateFormat.format(new Date()); + return "FXCJCZGTZS".concat(format); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/util/ExcelUtil.java b/security-service/ht-security/src/main/java/org/security/common/util/ExcelUtil.java new file mode 100644 index 0000000..26369ed --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/util/ExcelUtil.java @@ -0,0 +1,146 @@ +package org.security.common.util; + +import com.alibaba.cloud.commons.io.Charsets; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.read.builder.ExcelReaderBuilder; +import com.alibaba.excel.read.listener.ReadListener; +import com.alibaba.excel.util.DateUtils; +import com.alibaba.excel.util.StringUtils; +import lombok.SneakyThrows; +import org.springblade.core.excel.listener.DataListener; +import org.springblade.core.excel.listener.ImportListener; +import org.springblade.core.excel.support.ExcelException; +import org.springblade.core.excel.support.ExcelImporter; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URLEncoder; +import java.util.Date; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/3/30 10:51 + */ +public class ExcelUtil { + /** + * 读取excel的所有sheet数据 + * + * @param excel excel文件 + * @return List + */ + public static List read(MultipartFile excel, Class clazz) { + DataListener dataListener = new DataListener<>(); + ExcelReaderBuilder builder = getReaderBuilder(excel, dataListener, clazz); + if (builder == null) { + return null; + } + builder.doReadAll(); + return dataListener.getDataList(); + } + + /** + * 读取excel的指定sheet数据 + * + * @param excel excel文件 + * @param sheetNo sheet序号(从0开始) + * @return List + */ + public static List read(MultipartFile excel, int sheetNo, Class clazz) { + return read(excel, sheetNo, 1, clazz); + } + + /** + * 读取excel的指定sheet数据 + * + * @param excel excel文件 + * @param sheetNo sheet序号(从0开始) + * @param headRowNumber 表头行数 + * @return List + */ + public static List read(MultipartFile excel, int sheetNo, int headRowNumber, Class clazz) { + DataListener dataListener = new DataListener<>(); + ExcelReaderBuilder builder = getReaderBuilder(excel, dataListener, clazz); + if (builder == null) { + return null; + } + builder.sheet(sheetNo).headRowNumber(headRowNumber).doRead(); + return dataListener.getDataList(); + } + + /** + * 读取并导入数据 + * + * @param excel excel文件 + * @param importer 导入逻辑类 + * @param 泛型 + */ + public static void save(MultipartFile excel, ExcelImporter importer, Class clazz) { + ImportListener importListener = new ImportListener<>(importer); + ExcelReaderBuilder builder = getReaderBuilder(excel, importListener, clazz); + if (builder != null) { + builder.doReadAll(); + } + } + + /** + * 导出excel + * + * @param response 响应类 + * @param dataList 数据列表 + * @param clazz class类 + * @param 泛型 + */ + @SneakyThrows + public static void export(HttpServletResponse response, List dataList, Class clazz) { + export(response, DateUtils.format(new Date(), DateUtils.DATE_FORMAT_14), "导出数据", dataList, clazz); + } + + /** + * 导出excel + * + * @param response 响应类 + * @param fileName 文件名 + * @param sheetName sheet名 + * @param dataList 数据列表 + * @param clazz class类 + * @param 泛型 + */ + @SneakyThrows + public static void export(HttpServletResponse response, String fileName, String sheetName, List dataList, Class clazz) { + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("UTF-8"); + fileName = URLEncoder.encode(fileName, "GBK"); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + EasyExcel.write(response.getOutputStream(), clazz).sheet(sheetName).doWrite(dataList); + } + + /** + * 获取构建类 + * + * @param excel excel文件 + * @param readListener excel监听类 + * @return ExcelReaderBuilder + */ + public static ExcelReaderBuilder getReaderBuilder(MultipartFile excel, ReadListener readListener, Class clazz) { + String filename = excel.getOriginalFilename(); + if (StringUtils.isEmpty(filename)) { + throw new ExcelException("请上传文件!"); + } +// if ((!StringUtils.endsWithIgnoreCase(filename, ".xls") && !StringUtils.endsWithIgnoreCase(filename, ".xlsx"))) { + if (!filename.endsWith(".xls") && !filename.endsWith(".xlsx")) { + throw new ExcelException("请上传正确的excel文件!"); + } + InputStream inputStream; + try { + inputStream = new BufferedInputStream(excel.getInputStream()); + return EasyExcel.read(inputStream, clazz, readListener); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/util/MyCellStyleStrategyUtil.java b/security-service/ht-security/src/main/java/org/security/common/util/MyCellStyleStrategyUtil.java new file mode 100644 index 0000000..0ca13e2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/util/MyCellStyleStrategyUtil.java @@ -0,0 +1,65 @@ +package org.security.common.util; + +import com.alibaba.excel.metadata.data.DataFormatData; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.metadata.style.WriteFont; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.IndexedColors; + +/** + * @author Create by wzf + * @date 2022/5/30 14:37 + * + */ +public class MyCellStyleStrategyUtil { + /** + * + * @return + */ + public static HorizontalCellStyleStrategy getHorizontalCellStyleStrategy(){ + // 表头策略 + WriteCellStyle headerCellStyle = new WriteCellStyle(); + // 表头水平对齐居中 + headerCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); + // 背景色 + headerCellStyle.setFillForegroundColor(IndexedColors.WHITE1.getIndex()); + WriteFont headerFont = new WriteFont(); + headerFont.setFontHeightInPoints((short) 14); + headerCellStyle.setWriteFont(headerFont); + // 自动换行 + headerCellStyle.setWrapped(Boolean.FALSE); + + // 内容策略 + WriteCellStyle contentCellStyle = new WriteCellStyle(); + // 设置数据允许的数据格式,这里49代表所有可以都允许设置 + DataFormatData dataFormatData = new DataFormatData(); + dataFormatData.setIndex((short)49); + contentCellStyle.setDataFormatData(dataFormatData); + // 设置背景色: 需要指定 FillPatternType 为FillPatternType.SOLID_FOREGROUND 不然无法显示背景颜色.头默认了 FillPatternType所以可以不指定 + contentCellStyle.setFillPatternType(FillPatternType.NO_FILL); + contentCellStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex()); + // 设置内容靠左对齐 + contentCellStyle.setHorizontalAlignment(HorizontalAlignment.LEFT); + // 设置字体 + WriteFont contentFont = new WriteFont(); + contentFont.setFontHeightInPoints((short) 12); + contentCellStyle.setWriteFont(contentFont); + // 设置自动换行 + contentCellStyle.setWrapped(Boolean.FALSE); + // 设置边框样式和颜色 + contentCellStyle.setBorderLeft(BorderStyle.MEDIUM); + contentCellStyle.setBorderTop(BorderStyle.MEDIUM); + contentCellStyle.setBorderRight(BorderStyle.MEDIUM); + contentCellStyle.setBorderBottom(BorderStyle.MEDIUM); + contentCellStyle.setTopBorderColor(IndexedColors.BLACK1.getIndex()); + contentCellStyle.setBottomBorderColor(IndexedColors.BLACK1.getIndex()); + contentCellStyle.setLeftBorderColor(IndexedColors.BLACK1.getIndex()); + contentCellStyle.setRightBorderColor(IndexedColors.BLACK1.getIndex()); + + // 将格式加入单元格样式策略 + return new HorizontalCellStyleStrategy(headerCellStyle, contentCellStyle); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/util/QrCodeUtil.java b/security-service/ht-security/src/main/java/org/security/common/util/QrCodeUtil.java new file mode 100644 index 0000000..7d4077e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/util/QrCodeUtil.java @@ -0,0 +1,67 @@ +package org.security.common.util; + +import cn.hutool.core.codec.Base64; +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.common.BitMatrix; +import org.springblade.core.tool.utils.Func; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Create by wzf + * @date 2022/5/7 16:35 + * 二维码生成工具 + */ +public class QrCodeUtil { + + /** + * 生成二维码 + * @param qrCodeId 设备id + * @return + */ + public static String createQrCode(String qrCodeId){ + // 二维码需要使用到的颜色 + final int BLACK = 0xFF000000; + final int WHITE = 0xFFFFFFFF; + String base64 = ""; + // 需要生成的二维码的文字、地址 + String qrCodeStr = qrCodeId.concat("-").concat(Func.formatDateTime(new Date())); + // 创建二维码 + try { + Map charcter = new HashMap<>(); + // 设置字符集 + charcter.put(EncodeHintType.CHARACTER_SET, "UTF-8"); + // 设置二维码的四个参数 需要生成的字符串,类型设置为二维码,二维码宽度,二维码高度,字符串字符集 + BitMatrix bitMatrix = new MultiFormatWriter() + .encode(qrCodeStr, BarcodeFormat.QR_CODE, 500, 500, charcter); + // 二维码像素,也就是上面设置的 500 + int width = bitMatrix.getWidth(); + int height = bitMatrix.getHeight(); + // 创建二维码对象 + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + // 按照上面定义好的二维码颜色编码生成二维码 + image.setRGB(x, y, bitMatrix.get(x, y) ? BLACK : WHITE); + } + } + // 1、第一种方式 + // 生成的二维码图片对象转 base64 + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + // 设置图片的格式 + ImageIO.write(image, "png", stream); + // 生成的二维码base64 + base64 = Base64.encode(stream.toByteArray()); + } catch (Exception e) { + e.printStackTrace(); + } + return base64; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/util/TaskCehckUtil.java b/security-service/ht-security/src/main/java/org/security/common/util/TaskCehckUtil.java new file mode 100644 index 0000000..acc3e69 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/util/TaskCehckUtil.java @@ -0,0 +1,45 @@ +package org.security.common.util; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; + +import java.util.Date; + +/** + * @author zj 2022/4/27 + */ +public class TaskCehckUtil { + + /** + * 判断当前时间属于上半年/下半年 + * 返回上半年/下半年结束时间 + * + * @return + */ + public static Date getHalfYearEnd() { + DateTime date = DateUtil.date(); + int month = DateUtil.month(date); + if (month <= 6) { + String start = DateUtil.year(DateUtil.date()) + "-06-30 23:59:59"; + return DateUtil.parse(start, DatePattern.NORM_DATETIME_PATTERN); + } + return DateUtil.endOfYear(date); + } + + /** + * 判断当前时间属于上半年/下半年 + * 返回上半年/下半年开始时间 + * + * @return + */ + public static Date getHalfYearStart() { + DateTime date = DateUtil.date(); + int month = DateUtil.month(date); + if (month <= 6) { + return DateUtil.beginOfYear(date); + } + String start = DateUtil.year(DateUtil.date()) + "-07-01"; + return DateUtil.parse(start, DatePattern.NORM_DATE_FORMAT); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/util/XssUtils.java b/security-service/ht-security/src/main/java/org/security/common/util/XssUtils.java new file mode 100644 index 0000000..6eef390 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/util/XssUtils.java @@ -0,0 +1,65 @@ + + +package org.security.common.util; + +import org.jsoup.Jsoup; +import org.jsoup.safety.Whitelist; + +/** + * XSS过滤工具类 + * + * @author + * @since 1.0.0 + */ +public class XssUtils extends Whitelist { + + /** + * XSS过滤 + */ + public static String filter(String html){ + return Jsoup.clean(html, xssWhitelist()); + } + + /** + * XSS过滤白名单 + */ + private static Whitelist xssWhitelist(){ + return new Whitelist() + //支持的标签 + .addTags("a", "b", "blockquote", "br", "caption", "cite", "code", "col", "colgroup", "dd", "div", "dl", + "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "i", "img", "li", "ol", "p", "pre", "q", "small", + "strike", "strong","sub", "sup", "table", "tbody", "td","tfoot", "th", "thead", "tr", "u","ul", + "embed","object","param","span") + + //支持的标签属性 + .addAttributes("a", "href", "class", "style", "target", "rel", "nofollow") + .addAttributes("blockquote", "cite") + .addAttributes("code", "class", "style") + .addAttributes("col", "span", "width") + .addAttributes("colgroup", "span", "width") + .addAttributes("img", "align", "alt", "height", "src", "title", "width", "class", "style") + .addAttributes("ol", "start", "type") + .addAttributes("q", "cite") + .addAttributes("table", "summary", "width", "class", "style") + .addAttributes("tr", "abbr", "axis", "colspan", "rowspan", "width", "style") + .addAttributes("td", "abbr", "axis", "colspan", "rowspan", "width", "style") + .addAttributes("th", "abbr", "axis", "colspan", "rowspan", "scope","width", "style") + .addAttributes("ul", "type", "style") + .addAttributes("pre", "class", "style") + .addAttributes("div", "class", "id", "style") + .addAttributes("embed", "src", "wmode", "flashvars", "pluginspage", "allowFullScreen", "allowfullscreen", + "quality", "width", "height", "align", "allowScriptAccess", "allowscriptaccess", "allownetworking", "type") + .addAttributes("object", "type", "id", "name", "data", "width", "height", "style", "classid", "codebase") + .addAttributes("param", "name", "value") + .addAttributes("span", "class", "style") + + //标签属性对应的协议 + .addProtocols("a", "href", "ftp", "http", "https", "mailto") + .addProtocols("img", "src", "http", "https") + .addProtocols("blockquote", "cite", "http", "https") + .addProtocols("cite", "cite", "http", "https") + .addProtocols("q", "cite", "http", "https") + .addProtocols("embed", "src", "http", "https"); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/common/validator/ValidatorUtils.java b/security-service/ht-security/src/main/java/org/security/common/validator/ValidatorUtils.java new file mode 100644 index 0000000..14bc49d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/validator/ValidatorUtils.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) cn-fanya All rights reserved. + */ + +package org.security.common.validator; + +import org.security.common.exception.RenException; + +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import java.util.Set; + +/** + * hibernate-validator校验工具类 + * 参考文档:http://docs.jboss.org/hibernate/validator/6.0/reference/en-US/html_single/ + * + * @author zj + * @since 1.0.0 + */ +public class ValidatorUtils { + private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); + + /** + * 校验对象 + * @param object 待校验对象 + * @param groups 待校验的组 + */ + public static void validateEntity(Object object, Class... groups) + throws RenException { + Set> constraintViolations = validator.validate(object, groups); + if (!constraintViolations.isEmpty()) { + ConstraintViolation constraint = constraintViolations.iterator().next(); + throw new RenException(constraint.getMessage()); + } + } +} diff --git a/security-service/ht-security/src/main/java/org/security/common/validator/group/AddGroup.java b/security-service/ht-security/src/main/java/org/security/common/validator/group/AddGroup.java new file mode 100644 index 0000000..0be9a91 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/validator/group/AddGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) cn-fanya All rights reserved. + * + * + * + * + */ + +package org.security.common.validator.group; + +/** + * 新增 Group + * + * @author zj + * @since 1.0.0 + */ +public interface AddGroup { + +} diff --git a/security-service/ht-security/src/main/java/org/security/common/validator/group/DefaultGroup.java b/security-service/ht-security/src/main/java/org/security/common/validator/group/DefaultGroup.java new file mode 100644 index 0000000..d7ea311 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/validator/group/DefaultGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) cn-fanya All rights reserved. + * + * + * + * + */ + +package org.security.common.validator.group; + +/** + * 默认 Group + * + * @author zj + * @since 1.0.0 + */ +public interface DefaultGroup { + +} diff --git a/security-service/ht-security/src/main/java/org/security/common/validator/group/Group.java b/security-service/ht-security/src/main/java/org/security/common/validator/group/Group.java new file mode 100644 index 0000000..69a8068 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/validator/group/Group.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) cn-fanya All rights reserved. + * + * + * + * + */ + +package org.security.common.validator.group; + +import javax.validation.GroupSequence; + +/** + * 定义校验顺序,如果AddGroup组失败,则UpdateGroup组不会再校验 + * + * @author zj + * @since 1.0.0 + */ +@GroupSequence({AddGroup.class, UpdateGroup.class}) +public interface Group { + +} diff --git a/security-service/ht-security/src/main/java/org/security/common/validator/group/UpdateGroup.java b/security-service/ht-security/src/main/java/org/security/common/validator/group/UpdateGroup.java new file mode 100644 index 0000000..9902c6c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/common/validator/group/UpdateGroup.java @@ -0,0 +1,19 @@ +/** + * Copyright (c) cn-fanya All rights reserved. + * + * + * + * + */ + +package org.security.common.validator.group; + +/** + * 修改 Group + * + * @author zj + * @since 1.0.0 + */ +public interface UpdateGroup { + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/controller/AppController.java b/security-service/ht-security/src/main/java/org/security/trans/app/controller/AppController.java new file mode 100644 index 0000000..9d8535c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/controller/AppController.java @@ -0,0 +1,117 @@ +package org.security.trans.app.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.app.dto.AppDeviceCheckDTO; +import org.security.trans.app.service.IAppDeviceService; +import org.security.trans.app.service.IAppService; +import org.security.trans.app.service.IAppEducateService; +import org.security.trans.app.vo.AppDeviceCheckItemVO; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.app.vo.AppDeviceVO; +import org.security.trans.app.vo.TaskHandInVO; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import java.text.ParseException; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/20 9:47 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/app") +@Api(value = "app端接口", tags = "app端接口") +public class AppController extends BladeController { + private final IAppService appService; + private final IAppDeviceService appDeviceService; + private final IAppEducateService appEducateService; + + @ApiOperation(value = "根据当前用户查询待办") + @ApiOperationSupport(order = 0) + @ApiImplicitParams({ + @ApiImplicitParam(name = "type", value = "默认为空,查询前十条,all-查询全部", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "dataType", value = "默认为空,查询应急演练、教育培训、设备检查、设备整改的待办信息;1-教育培训待办信息、2-应急演练待办信息、" + + "3-设备检查待办信息、4-设备整改待办信息、5-设备持续整改代办信息", paramType = "query", dataType = "string") + }) + @GetMapping("/backlog") + public R> backlog(@RequestParam(required = false) String type,@RequestParam(required = false) String dataType) { + return R.data(appService.backlog(type,dataType)); + } + + @ApiOperation(value = "获取设备检查代办事项详情") + @ApiOperationSupport(order = 2) + @GetMapping("/device/{id}") + public R getDeviceDetail(@PathVariable String id) { + return R.data(appDeviceService.getDetail(id)); + } + + @ApiOperation(value = "获取教育培训和应急演练代办事项详情") + @ApiOperationSupport(order = 3) + @GetMapping("/{id}") + public R getDetail(@PathVariable String id) { + return R.data(appEducateService.getOtherDetail(id)); + } + + @ApiOperation(value = "教育培训和应急演练代办事项提报") + @ApiOperationSupport(order = 4) + @PostMapping("/handIn") + public R handInDetail(String id, List imgUrl) throws ParseException { + return R.status(appEducateService.handInDetail(id,imgUrl)); + } + + @ApiOperation(value = "获取设备检查/整改明细项详情") + @ApiOperationSupport(order = 5) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "id", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "type", value = "请求数据类型:1-设备检查待办数据,2-设备整改待办数据,3-设备持续整改数据", paramType = "query", dataType = "string") + }) + @GetMapping("/device/item") + public R> getDeviceItemDetail(@RequestParam String id,@RequestParam String type) { + return R.data(appDeviceService.getDeviceItemDetail(id,type)); + } + + @ApiOperation(value = "设备检查提报") + @ApiOperationSupport(order = 6) + @PostMapping("/device/handIn") + public R handInDevice(@Valid @RequestBody AppDeviceCheckDTO appDeviceCheckDTO){ + return R.status(appDeviceService.handInDevice(appDeviceCheckDTO)); + } + + @ApiOperation(value = "获取设备整改待办详情") + @ApiOperationSupport(order = 7) + @GetMapping("/device/rectify/{id}") + public R getDeviceRectifyDetail(@PathVariable String id) { + return R.data(appDeviceService.getDeviceRectifyDetail(id)); + } + + @ApiOperation(value = "设备整改提报") + @ApiOperationSupport(order = 8) + @PostMapping("/device/rectify") + public R rectifyDevice(@Valid @RequestBody AppDeviceCheckDTO appDeviceCheckDTO){ + return R.status(appDeviceService.rectifyDevice(appDeviceCheckDTO)); + } + + @ApiOperation(value = "获取设备持续整改待办详情") + @ApiOperationSupport(order = 9) + @GetMapping("/continued/rectify/{id}") + public R getContinuedRectifyDetail(@PathVariable String id) { + return R.data(appDeviceService.getContinuedRectifyDetail(id)); + } + + @ApiOperation(value = "设备持续整改提报") + @ApiOperationSupport(order = 10) + @PostMapping("/continued/rectify/handIn") + public R continuedRectifyHandIn(@Valid @RequestBody AppDeviceCheckDTO appDeviceCheckDTO){ + return R.status(appDeviceService.continuedRectifyHandIn(appDeviceCheckDTO)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/dto/AppDeviceCheckDTO.java b/security-service/ht-security/src/main/java/org/security/trans/app/dto/AppDeviceCheckDTO.java new file mode 100644 index 0000000..0352557 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/dto/AppDeviceCheckDTO.java @@ -0,0 +1,31 @@ +package org.security.trans.app.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/25 14:39 + */ +@Data +public class AppDeviceCheckDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * id + */ + private String id; + + /** + * 设备检查项明细 + */ + private List appDeviceDTOList; + + + /** + * 备注 + */ + private String remark; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/dto/AppDeviceDTO.java b/security-service/ht-security/src/main/java/org/security/trans/app/dto/AppDeviceDTO.java new file mode 100644 index 0000000..a529e94 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/dto/AppDeviceDTO.java @@ -0,0 +1,39 @@ +package org.security.trans.app.dto; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import org.springframework.web.multipart.MultipartFile; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/25 11:27 + */ +@Data +public class AppDeviceDTO extends DeviceInspectionLine implements Serializable { + private static final long serialVersionUID = 1L; + + + /** + * 可持续整改标识(1-普通整改,2-持续整改) + */ + private String recordFlag; + + /** + * 持续整改期限 + */ + @ApiModelProperty(value = "持续整改期限") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectificationDeadline; + + /** + * 照片 + */ + private List imgUrl; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/dto/TaskHandInDTO.java b/security-service/ht-security/src/main/java/org/security/trans/app/dto/TaskHandInDTO.java new file mode 100644 index 0000000..46f6c88 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/dto/TaskHandInDTO.java @@ -0,0 +1,24 @@ +package org.security.trans.app.dto; + +import lombok.Data; +import org.security.trans.app.vo.TaskHandInVO; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/25 10:33 + */ +@Data +public class TaskHandInDTO extends TaskHandInVO { + /** + * id + */ + private String id; + + /** + * 照片url + */ + private List imgUrl; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/mapper/AppMapper.java b/security-service/ht-security/src/main/java/org/security/trans/app/mapper/AppMapper.java new file mode 100644 index 0000000..117be64 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/mapper/AppMapper.java @@ -0,0 +1,8 @@ +package org.security.trans.app.mapper; + +/** + * @author Create by wzf + * @date 2022/4/20 9:55 + */ +public interface AppMapper { +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/service/IAppDeviceService.java b/security-service/ht-security/src/main/java/org/security/trans/app/service/IAppDeviceService.java new file mode 100644 index 0000000..ae31e02 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/service/IAppDeviceService.java @@ -0,0 +1,63 @@ +package org.security.trans.app.service; + +import org.security.trans.app.dto.AppDeviceCheckDTO; +import org.security.trans.app.vo.AppDeviceCheckItemVO; +import org.security.trans.app.vo.AppDeviceVO; + +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/28 11:27 + */ +public interface IAppDeviceService { + + /** + *获取设备代办事项详情 + * @param id + * @return + */ + AppDeviceVO getDetail(String id); + + /** + * 获取设备检查项详情 + * @param id 设备检查id + * @return + */ + List getDeviceItemDetail(String id,String type); + + /** + * 设备检查提报 + * @param appDeviceCheckDTO 设备检查项 + * @return + */ + boolean handInDevice(AppDeviceCheckDTO appDeviceCheckDTO); + + /** + * 获取设备整改项详情 + * @param id + * @return + */ + AppDeviceVO getDeviceRectifyDetail(String id); + + /** + * 设备整改提报 + * @param appDeviceCheckDTO 设备整改项明细信息 + * @return + */ + boolean rectifyDevice(AppDeviceCheckDTO appDeviceCheckDTO); + + /** + * 获取设备持续整改待办详情 + * @param id + * @return + */ + AppDeviceVO getContinuedRectifyDetail(String id); + + /** + * 设备持续整改提报 + * @param appDeviceCheckDTO 设备持续整改信息 + * @return + */ + boolean continuedRectifyHandIn(AppDeviceCheckDTO appDeviceCheckDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/service/IAppEducateService.java b/security-service/ht-security/src/main/java/org/security/trans/app/service/IAppEducateService.java new file mode 100644 index 0000000..de5cbe2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/service/IAppEducateService.java @@ -0,0 +1,31 @@ +package org.security.trans.app.service; + +import org.security.trans.app.dto.TaskHandInDTO; +import org.security.trans.app.vo.TaskHandInVO; +import org.springframework.web.multipart.MultipartFile; + +import java.text.ParseException; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/28 11:39 + */ +public interface IAppEducateService { + + /** + * 获取教育培训和应急演练代办事项详情 + * @param id + * @return + */ + TaskHandInVO getOtherDetail(String id); + + + /** + * 教育培训和应急演练代办事项提报 + * @param imgUrl 教育培训和应急演练代办事项 + * @return + * @throws ParseException + */ + boolean handInDetail(String id, List imgUrl) throws ParseException; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/service/IAppService.java b/security-service/ht-security/src/main/java/org/security/trans/app/service/IAppService.java new file mode 100644 index 0000000..844f5c5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/service/IAppService.java @@ -0,0 +1,21 @@ +package org.security.trans.app.service; + +import org.security.trans.app.dto.AppDeviceCheckDTO; +import org.security.trans.app.dto.TaskHandInDTO; +import org.security.trans.app.vo.AppDeviceCheckItemVO; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.app.vo.AppDeviceVO; +import org.security.trans.app.vo.TaskHandInVO; + +import java.text.ParseException; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/20 9:51 + */ +public interface IAppService{ + + List backlog(String type,String dataType); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppDeviceServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppDeviceServiceImpl.java new file mode 100644 index 0000000..16dcd75 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppDeviceServiceImpl.java @@ -0,0 +1,321 @@ +package org.security.trans.app.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.feign.ISysClient; +import org.security.trans.app.dto.AppDeviceCheckDTO; +import org.security.trans.app.dto.AppDeviceDTO; +import org.security.trans.app.service.IAppDeviceService; +import org.security.trans.app.vo.AppDeviceCheckItemVO; +import org.security.trans.app.vo.AppDeviceVO; +import org.security.ht.entity.basic.Device; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.basic.service.IDeviceService; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import org.security.trans.dailyDuties.service.IDeviceInspectionLineService; +import org.security.trans.dailyDuties.service.IDeviceInspectionService; +import org.security.trans.settings.service.IDeviceCategorySettingsService; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author Create by wzf + * @date 2022/4/28 11:27 + */ +@AllArgsConstructor +@Service +public class AppDeviceServiceImpl implements IAppDeviceService { + private final IDepartmentService departmentService; + private final IDeviceService deviceService; + private final IDeviceCategorySettingsService deviceCategorySettingsService; + private final IDeviceInspectionService deviceInspectionService; + private final IDeviceInspectionLineService deviceInspectionLineService; + private final IFileService fileService; + private final IFlowClient flowClient; + private final ISysClient sysClient; + + + @Override + public AppDeviceVO getDetail(String id) { + //获取待检设备的设备id + DeviceInspection deviceInspection = deviceInspectionService.getOne(new QueryWrapper().lambda() + .eq(Func.isNotBlank(id), DeviceInspection::getId, id) + .and(item -> item.eq(DeviceInspection::getStatus, Constant.DEVICE_STATE_INSPECTION) + .or().eq(DeviceInspection::getStatus, Constant.DEVICE_STATE_OVERTIME_INSPECTION) + .or().eq(DeviceInspection::getState,Constant.HANDIN_STATE_REFUSE) + .or().eq(DeviceInspection::getState,ProcessConstant.CANCEL_STATE))); + //获取设备信息 + AppDeviceVO deviceVO = getAppDeviceDetail(deviceInspection); + deviceVO.setState(Constant.DEVICE_STATE_INSPECTION.equals(deviceInspection.getStatus()) ? "待检查" : "超期未检查"); + return deviceVO; + } + + /** + * 获取设备详情 + */ + private AppDeviceVO getAppDeviceDetail(DeviceInspection deviceInspection) { + Device device = deviceService.getById(deviceInspection.getDeviceId()); + AppDeviceVO deviceVO = Func.copy(device, AppDeviceVO.class); + deviceVO.setDepName(departmentService.getById(device.getDepId()).getFullName()); + deviceVO.setTypeName(deviceCategorySettingsService.getById(device.getTypeId()).getName()); + return deviceVO; + } + + + @Override + public List getDeviceItemDetail(String id,String type) { + //设备检查待办明细数据 + List deviceInspectionLineList = new ArrayList<>(); + if ("1".equals(type)){ + deviceInspectionLineList = deviceInspectionLineService.list(new QueryWrapper().lambda() + .eq(Func.isNotBlank(id),DeviceInspectionLine::getFormId, id)); + } + //设备整改待办明细数据 + if ("2".equals(type)){ + deviceInspectionLineList = deviceInspectionLineService.list(new QueryWrapper().lambda() + .eq(Func.isNotBlank(id),DeviceInspectionLine::getFormId, id) + .eq(DeviceInspectionLine::getProblemLevel,Constant.DEVICE_PROBLEM_WARN) +// .eq(DeviceInspectionLine::getStatus,Constant.DEVICE_STATE_RECTIFY) + .eq(DeviceInspectionLine::getRecFlag,Constant.PROBLEM_STATE_USUUAL)); + } + //设备持续整改待办明细数据 + if ("3".equals(type)){ + deviceInspectionLineList = deviceInspectionLineService.list(new QueryWrapper().lambda() + .eq(Func.isNotBlank(id),DeviceInspectionLine::getId, id) + .eq(DeviceInspectionLine::getProblemLevel,Constant.DEVICE_PROBLEM_WARN) +// .eq(DeviceInspectionLine::getStatus,Constant.DEVICE_STATE_RECTIFY) + .eq(DeviceInspectionLine::getRecFlag,Constant.PROBLEM_STATE_CONTINUED)); + } + return setAppDeviceCheckItemVOS(deviceInspectionLineList); + } + + /** + * 给设备检查或整改项返回值赋值 + */ + private ArrayList setAppDeviceCheckItemVOS(List deviceInspectionLineList) { + ArrayList list = new ArrayList<>(); + if (Func.isNotEmpty(deviceInspectionLineList)) { + deviceInspectionLineList.forEach(item -> { + AppDeviceCheckItemVO itemVO = Func.copy(item, AppDeviceCheckItemVO.class); + itemVO.setBeforeImages(fileService.getAttachments(item.getId(),item.getBeforePicIds())); + itemVO.setAfterImages(fileService.getAttachments(item.getId(),item.getAfterPicIds())); + list.add(itemVO); + }); + } + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean handInDevice(AppDeviceCheckDTO appDeviceCheckDTO) { + + //筛选出检查结果状态为告警的数据 + List collect = appDeviceCheckDTO.getAppDeviceDTOList().stream().filter(item -> Constant.DEVICE_PROBLEM_WARN.equals(item.getProblemLevel())).collect(Collectors.toList()); + //更新设备检查主表状态 + DeviceInspection deviceInspection = deviceInspectionService.getById(appDeviceCheckDTO.getId()); + deviceInspection.setStatus(Func.isNotEmpty(collect) ? Constant.DEVICE_STATE_RECTIFY : Constant.DEVICE_STATE_INSPECTION_OVER); + deviceInspection.setRemark(Func.isNotEmpty(appDeviceCheckDTO.getRemark()) ? appDeviceCheckDTO.getRemark() : "无"); + deviceInspection.setInspectUser(String.valueOf(AuthUtil.getUser().getUserId())); + deviceInspection.setInspectTime(new Date());//检查时间 + //更新基础信息设备状态及最新检查时间 + Device device = deviceService.getById(deviceInspection.getDeviceId()); + device.setState(device.getOrgState()); + device.setOrgState(""); + device.setLatestInspectionTime(new Date()); + if (Func.isNotEmpty(appDeviceCheckDTO.getAppDeviceDTOList())) { + //更新设备检查明细信息 + appDeviceCheckDTO.getAppDeviceDTOList().forEach(this::updateDeviceItem); + } + //如果检查明细不存在异常明细项,则提报给领导确认 + if (Func.isEmpty(collect)) { + deviceInspection.setFinishTime(new Date());//无异常则检查提交时间就是办结时间,有异常需要等待完成整改 + deviceInspection.setState(Constant.HANDIN_STATE_AUDIT); + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.DEVICE_INSPECTION_KEY); + if (definitionRes.isSuccess()) { + deviceInspection.setProcessDefinitionId(definitionRes.getData().getId()); + deviceInspection.setInsProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + String businessTable = FlowUtil.getBusinessTable(DeviceInspection.class); + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, deviceInspection.getId()); + R result = flowClient.startProcessInstanceById(deviceInspection.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(deviceInspection.getId())), variables); + if (!result.isSuccess()) { + throw new ServiceException("开启流程失败"); + } + deviceInspection.setProcessInstanceId(result.getData().getProcessInstanceId()); + deviceInspection.setInsProcessInstanceId(result.getData().getProcessInstanceId()); + } + return deviceInspectionService.updateById(deviceInspection) && deviceService.updateById(device); + } + + /** + * 更新设备检查项 + */ + private void updateDeviceItem(AppDeviceDTO item) { + DeviceInspectionLine deviceInspectionLine = deviceInspectionLineService.getById(item.getId()); + deviceInspectionLine.setDeviceState(Constant.DEVICE_LINE_STATE_2); + deviceInspectionLine.setProblemLevel(item.getProblemLevel()); + deviceInspectionLine.setRectificationStatus(Constant.DEVICE_PROBLEM_NORMAL);//提交检查时,默认整改结果状态为1-正常 + deviceInspectionLine.setBeforePicIds(item.getBeforePicIds()); + deviceInspectionLine.setStatus(Constant.DEVICE_PROBLEM_NORMAL.equals(item.getProblemLevel()) ? Constant.DEVICE_STATE_INSPECTION_OVER : Constant.DEVICE_STATE_RECTIFY); + deviceInspectionLine.setRecFlag(Constant.DEVICE_PROBLEM_NORMAL.equals(item.getProblemLevel()) ? null : Constant.PROBLEM_STATE_USUUAL); + //保存整改前图片 + fileService.saveAttachments(item.getImgUrl(), item.getId()); + deviceInspectionLine.setResult(item.getResult()); + deviceInspectionLineService.updateById(deviceInspectionLine); + } + + @Override + public AppDeviceVO getDeviceRectifyDetail(String id) { + //获取待整改设备的设备id + DeviceInspection deviceInspection = deviceInspectionService.getOne(new QueryWrapper().lambda().eq(Func.isNotBlank(id), DeviceInspection::getId, id)); +// .eq(DeviceInspection::getStatus, Constant.DEVICE_STATE_RECTIFY)); //注释于20230711 id唯一,不用再加状态 + //获取设备信息 + AppDeviceVO deviceVO = getAppDeviceDetail(deviceInspection); + deviceVO.setState("待整改"); + return deviceVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean rectifyDevice(AppDeviceCheckDTO appDeviceCheckDTO) { + //更新设备整改主表状态 + DeviceInspection deviceInspection = deviceInspectionService.getById(appDeviceCheckDTO.getId()); + deviceInspection.setStatus(Constant.DEVICE_STATE_RECTIFY_OVER); + deviceInspection.setFinishTime(new Date());//提交整改时间为办结时间 + deviceInspection.setRectifyUser(String.valueOf(AuthUtil.getUser().getUserId()));//提交人为整改人 + deviceInspection.setState(Constant.HANDIN_STATE_AUDIT); + //更新设备整改明细信息 + if (Func.isNotEmpty(appDeviceCheckDTO.getAppDeviceDTOList())) { + appDeviceCheckDTO.getAppDeviceDTOList().forEach(item -> { + DeviceInspectionLine deviceInspectionLine = deviceInspectionLineService.getById(item.getId()); + deviceInspectionLine.setRectificationStatus(item.getRectificationStatus()); + deviceInspectionLine.setRectifyResult(item.getRectifyResult()); + deviceInspectionLine.setAfterPicIds(item.getAfterPicIds()); + deviceInspectionLine.setRecFlag(Constant.PROBLEM_STATE_USUUAL); + deviceInspectionLine.setStatus(Constant.DEVICE_STATE_RECTIFY_OVER); + deviceInspectionLine.setState(Constant.HANDIN_STATE_AUDIT); + //存储原纪录id + deviceInspectionLineService.updateById(deviceInspectionLine); + //保存整改后相关图片 + fileService.saveAttachments(item.getImgUrl(), item.getId()); + //判断该设备检查是否需要持续整改 + setContinuedRectify(item, deviceInspectionLine); + }); + } + //设备整改完成进入领导确认流程 + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.DEVICE_INSPECTION_REC_KEY); + if (definitionRes.isSuccess()) { + deviceInspection.setProcessDefinitionId(definitionRes.getData().getId()); + deviceInspection.setRecProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + String businessTable = FlowUtil.getBusinessTable(DeviceInspection.class); + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, deviceInspection.getId()); + R result = flowClient.startProcessInstanceById(deviceInspection.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(deviceInspection.getId())), variables); + if (!result.isSuccess()) { + throw new ServiceException("开启流程失败"); + } + deviceInspection.setProcessInstanceId(result.getData().getProcessInstanceId()); + deviceInspection.setRecProcessInstanceId(result.getData().getProcessInstanceId()); + return deviceInspectionService.updateById(deviceInspection); + } + + private void setContinuedRectify(AppDeviceDTO item, DeviceInspectionLine deviceInspectionLine) { + if (Func.isNotEmpty(item.getRecordFlag()) && Constant.PROBLEM_STATE_CONTINUED.equals(item.getRecordFlag())){ + deviceInspectionLine.setId(null); + deviceInspectionLine.setRecFlag(Constant.PROBLEM_STATE_CONTINUED); + deviceInspectionLine.setRectificationDeadline(item.getRectificationDeadline()); + deviceInspectionLine.setStatus(Constant.DEVICE_STATE_LEADER_CONFIRM); + deviceInspectionLine.setDeptId(AuthUtil.getDeptId()); + deviceInspectionLine.setState(Constant.HANDIN_STATE_DRAFT); + deviceInspectionLine.setRectificationStatus(Constant.DEVICE_PROBLEM_NORMAL);//创建的持续整改默认整改结果为1-正常 + deviceInspectionLine.setRectifyResult(""); + deviceInspectionLineService.save(deviceInspectionLine); + //保存相关附件 + fileService.saveAttachments(item.getImgUrl(),deviceInspectionLine.getId()); + } + } + + @Override + public AppDeviceVO getContinuedRectifyDetail(String id) { + //获取设备整改明细信息 + DeviceInspectionLine deviceInspectionLine = deviceInspectionLineService.getById(id); + DeviceInspection deviceInspection = deviceInspectionService.getById(deviceInspectionLine.getFormId()); + AppDeviceVO appDeviceVO = getAppDeviceDetail(deviceInspection); + appDeviceVO.setState("持续整改"); + return appDeviceVO; + } + + @Override + public boolean continuedRectifyHandIn(AppDeviceCheckDTO appDeviceCheckDTO) { + //判断持续整改明细是否需要再次申请持续整改 + if (Func.isNotEmpty(appDeviceCheckDTO.getAppDeviceDTOList())){ + appDeviceCheckDTO.getAppDeviceDTOList().forEach(item -> { + DeviceInspectionLine deviceInspectionLine = deviceInspectionLineService.getById(item.getId()); + deviceInspectionLine.setState(Constant.HANDIN_STATE_AUDIT); + deviceInspectionLine.setStatus(Constant.DEVICE_STATE_RECTIFY_OVER); + deviceInspectionLine.setRectificationStatus(item.getRectificationStatus()); + deviceInspectionLine.setRectifyResult(item.getRectifyResult()); + deviceInspectionLine.setAfterPicIds(item.getAfterPicIds()); + //存储原纪录id + deviceInspectionLineService.updateById(deviceInspectionLine); + //保存整改后相关图片 + fileService.saveAttachments(item.getImgUrl(), item.getId()); + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.DEVICE_INS_REC_CON_KEY); + if (definitionRes.isSuccess()) { + deviceInspectionLine.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + String businessTable = FlowUtil.getBusinessTable(DeviceInspectionLine.class); + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, deviceInspectionLine.getId()); + R result = flowClient.startProcessInstanceById(deviceInspectionLine.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(deviceInspectionLine.getId())), variables); + if (!result.isSuccess()) { + throw new ServiceException("开启流程失败"); + } + //再次发起持续整改 + setContinuedRectify(item,deviceInspectionLine); + }); + } + return true; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppEducateServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppEducateServiceImpl.java new file mode 100644 index 0000000..dab4a49 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppEducateServiceImpl.java @@ -0,0 +1,71 @@ +package org.security.trans.app.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.common.util.DataFormatUtil; +import org.security.trans.app.service.IAppEducateService; +import org.security.trans.app.vo.TaskHandInVO; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.flow.dto.FlowStartDTO; +import org.security.trans.flow.service.IFlowHistoryService; +import org.security.trans.task.entity.Task; +import org.security.trans.task.entity.TaskHandin; +import org.security.trans.task.service.ITaskHandinService; +import org.security.trans.task.service.ITaskService; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.text.ParseException; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/28 11:39 + */ +@AllArgsConstructor +@Service +public class AppEducateServiceImpl implements IAppEducateService { + private final ITaskHandinService taskHandinService; + private final ITaskService taskService; + private final IDepartmentService departmentService; + private final IFlowHistoryService flowHistoryService; + + + @Override + public TaskHandInVO getOtherDetail(String id) { + TaskHandInVO taskHandInVO = new TaskHandInVO(); + TaskHandin taskHandin = taskHandinService.getOne(new QueryWrapper().lambda().eq(Func.isNotBlank(id), TaskHandin::getId, id) + .and(item -> item.eq(TaskHandin::getState, Constant.HANDIN_STATE_DRAFT).or().eq(TaskHandin::getState, Constant.HANDIN_STATE_DRAFT))); + if (Func.isNotEmpty(taskHandin)){ + //获取参加人数 + taskHandInVO.setJoinNumber(Func.isNotEmpty(taskHandin.getPeopleNumber())?Integer.parseInt(String.valueOf(taskHandin.getPeopleNumber())):0); + //获取当前机构 + taskHandInVO.setDeptName(departmentService.getById(taskHandin.getDeptId()).getFullName()); + //获取待办标题和描述 + Task task = taskService.getById(taskHandin.getTaskId()); + taskHandInVO.setTitle(task.getName()); + taskHandInVO.setScript(task.getSummary()); + } + return taskHandInVO; + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean handInDetail(String id, List imgUrl) throws ParseException { + //获取提报期限 + TaskHandin taskHandin = taskHandinService.getById(id); + taskHandin.setState(Constant.HANDIN_STATE_AUDIT); + //判断提报是否超期 +// taskHandin.setStatus(taskHandin.getDeadline().before(DataFormatUtil.getLocalDate())?Constant.HANDIN_STATE_OVERTIME_SUBMIT:Constant.HANDIN_STATE_SUBMIT); +// taskHandin.setPicIds(taskHandInDTO.getImgUrl()); + //加入流程 + FlowStartDTO flowStartDTO = new FlowStartDTO(); + flowStartDTO.setFlowBusinessCode(taskHandin.getBusinessType()); + flowStartDTO.setBusinessLinkId(taskHandin.getId()); + return taskHandinService.saveOrUpdate(taskHandin) && flowHistoryService.startFlow(flowStartDTO); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppServiceImpl.java new file mode 100644 index 0000000..fc817fd --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/service/impl/AppServiceImpl.java @@ -0,0 +1,194 @@ +package org.security.trans.app.service.impl; + +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.common.eum.TaskBusinessTypeEnum; +import org.security.trans.app.service.IAppService; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.basic.service.IDeviceService; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.service.IDeviceInspectionLineService; +import org.security.trans.dailyDuties.service.IDeviceInspectionService; +import org.security.trans.task.service.ITaskHandinService; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author Create by wzf + * @date 2022/4/20 9:52 + */ +@AllArgsConstructor +@Service +public class AppServiceImpl implements IAppService { + private final ITaskHandinService taskHandinService; + private final IDeviceInspectionService deviceInspectionService; + private final IDeviceInspectionLineService deviceInspectionLineService; + private final IDeviceService deviceService; + private final IFileService fileService; + + @Override + public List backlog(String type,String dataType) { + BladeUser user = AuthUtil.getUser(); + //模块标识符 + String moduleType = ""; + //设备待办状态值list + ArrayList list = new ArrayList<>(); + //获取教育培训待办信息 + if(Constant.APP_BACKLOG_TYPE_1.equals(dataType)){ + moduleType = "edu"; + List taskHandinBacklog = taskHandinService.getAppBacklog(user,moduleType); + return setBacklogVOS(type, taskHandinBacklog); + } + //获取应急演练待办信息 + if(Constant.APP_BACKLOG_TYPE_2.equals(dataType)){ + moduleType = "drill"; + List taskHandinBacklog = taskHandinService.getAppBacklog(user,moduleType); + return setBacklogVOS(type, taskHandinBacklog); + } + //获取设备检查待办信息 + if (Constant.APP_BACKLOG_TYPE_3.equals(dataType)){ + List deviceCheckBacklogs = getDeviceCheckData(user, list); + return setBacklogVOS(type, deviceCheckBacklogs); + } + //获取设备整改待办信息 + if (Constant.APP_BACKLOG_TYPE_4.equals(dataType)){ + List deviceCheckBacklogs = getDeviceRectifyData(user, list); + return setBacklogVOS(type, deviceCheckBacklogs); + } + //获取设备持续整改代办信息 + if (Constant.APP_BACKLOG_TYPE_5.equals(dataType)){ + List deviceContinuedBacklogs = getDeviceContinuedRectifyData(user,list); + return setBacklogVOS(type, deviceContinuedBacklogs); + } + //获取所有待办数据:设备检查、设备整改、设备持续整改 + if (!Func.isNotBlank(dataType)){ + ArrayList list1 = new ArrayList<>(); + ArrayList list2 = new ArrayList<>(); + ArrayList list3 = new ArrayList<>(); + List taskHandInBacklog = new ArrayList<>(); + List deviceCheckBacklogs = getDeviceCheckData(user, list1); + taskHandInBacklog.addAll(deviceCheckBacklogs); + List deviceRectifyBacklogs = getDeviceRectifyData(user, list2); + taskHandInBacklog.addAll(deviceRectifyBacklogs); + List deviceContinuedBacklogs = getDeviceContinuedRectifyData(user,list3); + taskHandInBacklog.addAll(deviceContinuedBacklogs); + +// List taskHandInBacklog = getAllBacklogData(user, moduleType, list); + return setBacklogVOS(type, taskHandInBacklog); + } + return null; + } + + /** + *获取设备持续整改信息 + * @return + */ + private List getDeviceContinuedRectifyData(BladeUser user,List list) { + list.add(Constant.DEVICE_STATE_RECTIFY); + list.add(Constant.DEVICE_STATE_RECTIFY_OVER);//ADD at 20230712:持续整改被驳回后也要查出待办 + List deviceContinuedData = deviceInspectionLineService.getData(user,list,Constant.PROBLEM_STATE_CONTINUED); + if (Func.isNotEmpty(deviceContinuedData)){ + deviceContinuedData.forEach(item ->{ + item.setInspectUserName(fileService.getUserNameById(item.getInspectUser())); + item.setRectifyUserName(fileService.getUserNameById(item.getRectifyUser())); + item.setBusinessType("device_continued_rectify"); + item.setModule("deviceContinuedRectify"); + }); + } + return deviceContinuedData; + } + + /** + *获取app端设备整改待办数据 + */ + private List getDeviceRectifyData(BladeUser user, ArrayList list) { + list.add(Constant.DEVICE_STATE_RECTIFY); + list.add(Constant.DEVICE_STATE_RECTIFY_OVER);//20230711add:状态为7-已整改,但审批驳回的 + List deviceCheckBacklogs = deviceInspectionService.getAppBacklog(user,list); + if (Func.isNotEmpty(deviceCheckBacklogs)){ + deviceCheckBacklogs.forEach(item->{ + item.setInspectUserName(fileService.getUserNameById(item.getInspectUser())); + item.setRectifyUserName(fileService.getUserNameById(item.getRectifyUser())); + item.setBusinessType("device_rectify"); + item.setModule("deviceRectify"); + }); + } + return deviceCheckBacklogs; + } + + /** + *获取app端所有待办数据 + */ + private List getAllBacklogData(BladeUser user, String moduleType, ArrayList list) { + list.add(Constant.DEVICE_STATE_INSPECTION); + list.add(Constant.DEVICE_STATE_OVERTIME_INSPECTION); + list.add(Constant.DEVICE_STATE_RECTIFY); +// List taskHandInBacklog = taskHandinService.getAppBacklog(user, moduleType); + List deviceCheckBacklogs = deviceInspectionService.getAppBacklog(user, list); + if (Func.isNotEmpty(deviceCheckBacklogs)){ + deviceCheckBacklogs.forEach(item->{ + item.setDeviceNum(deviceService.getById(item.getDeviceId()).getDeviceNum()); + if (Constant.DEVICE_STATE_INSPECTION.equals(item.getStatus()) || Constant.DEVICE_STATE_OVERTIME_INSPECTION.equals(item.getStatus())){ + item.setBusinessType("device_check"); + item.setModule("deviceCheck"); + } + if (Constant.DEVICE_STATE_RECTIFY.equals(item.getStatus())){ + item.setBusinessType("device_rectify"); + item.setModule("deviceRectify"); + } + }); + } + return deviceCheckBacklogs; + } + + /** + *获取设备检查待办数据 + */ + private List getDeviceCheckData(BladeUser user, ArrayList list) { + list.add(Constant.DEVICE_STATE_INSPECTION); + list.add(Constant.DEVICE_STATE_OVERTIME_INSPECTION); + list.add(Constant.DEVICE_STATE_INSPECTION_OVER);//20230711add:已检查完成但处于未审批、审批驳回的也是待办 + List deviceCheckBacklogs = deviceInspectionService.getAppBacklog(user, list); + if (Func.isNotEmpty(deviceCheckBacklogs)){ + deviceCheckBacklogs.forEach(item->{ + item.setInspectUserName(fileService.getUserNameById(item.getInspectUser())); + item.setRectifyUserName(fileService.getUserNameById(item.getRectifyUser())); + item.setBusinessType("device_check"); + item.setModule("deviceCheck"); + }); + } + return deviceCheckBacklogs; + } + + /** + *设置app待办返回值 + */ + private List setBacklogVOS(String type, List taskHandInBacklog) { + for (BacklogVO vo : taskHandInBacklog) { + if(!Func.isNull(vo.getDeadline()) && Func.isNotEmpty(vo.getDeadline()) ){ + vo.setOverTime(String.valueOf(vo.getDeadline().getTime() - DateUtil.now().getTime())); + } + vo.setBusinessType(TaskBusinessTypeEnum.convertToName(vo.getBusinessType())); + } + if (StringUtil.equals("all", type)) { + return taskHandInBacklog; + } + return taskHandInBacklog.stream().limit(10).collect(Collectors.toList()); + } + + + + + + + + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/vo/AppDeviceCheckItemVO.java b/security-service/ht-security/src/main/java/org/security/trans/app/vo/AppDeviceCheckItemVO.java new file mode 100644 index 0000000..450d397 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/vo/AppDeviceCheckItemVO.java @@ -0,0 +1,43 @@ +package org.security.trans.app.vo; + +import lombok.Data; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; + +import java.io.Serializable; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/25 14:44 + */ +@Data +public class AppDeviceCheckItemVO extends DeviceInspectionLine implements Serializable { + /** + * id + */ + private String id; + + /** + * 检查项名称 + */ + private String name; + + /** + * 检查结果 + */ + private String result; + /** + * 检查结果状态 + */ + private String problemLevel; + /** + * 整改前图片 + */ + private List beforeImages; + + /** + * 整改后图片 + */ + private List afterImages; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/vo/AppDeviceVO.java b/security-service/ht-security/src/main/java/org/security/trans/app/vo/AppDeviceVO.java new file mode 100644 index 0000000..a1442e3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/vo/AppDeviceVO.java @@ -0,0 +1,88 @@ +package org.security.trans.app.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.vo.common.UploadVO; + +import java.io.Serializable; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/4/24 14:18 + */ +@Data +public class AppDeviceVO implements Serializable { + private static final long serialVersionUID = 1L; + + private String id; + + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + private String name; + + /** + * 设备编号 + */ + @ApiModelProperty(value = "设备编号") + private String deviceNum; + + /** + * 设备厂商 + */ + @ApiModelProperty(value = "设备厂商") + private String company; + + /** + * 设备型号 + */ + @ApiModelProperty(value = "设备型号") + private String modelNum; + + /** + * 设备类型 + */ + @ApiModelProperty(value = "设备类型") + private String typeName; + + /** + * 所属机构 + */ + @ApiModelProperty(value = "所属机构") + private String depName; + + /** + * 维保到期时间 + */ + @ApiModelProperty(value = "维保到期时间") + private String maintenanceDate; + + /** + * 放置地址 + */ + @ApiModelProperty(value = "放置地址") + private String address; + + /** + * 4-检查中,5-检查完成,6-待整改,7-整改完成,8-超期未检查 + */ + @ApiModelProperty(value = "4-检查中,5-检查完成,6-待整改,7-整改完成,8-超期未检查") + private String state; + + /** + * 整改前图片附件 + */ + private List beforeAttachments; + + /** + * 整改后图片附件 + */ + private List afterAttachments; + /** + * 检查时必须先扫码(0-否 1-是) + */ + private String needScan; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/vo/BacklogVO.java b/security-service/ht-security/src/main/java/org/security/trans/app/vo/BacklogVO.java new file mode 100644 index 0000000..52e9860 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/vo/BacklogVO.java @@ -0,0 +1,68 @@ +package org.security.trans.app.vo; + +import cn.hutool.core.date.DatePattern; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @author zj 2022/4/21 + */ +@Data +public class BacklogVO { + + @ApiModelProperty("业务数据id") + private String id; + + @ApiModelProperty("业务类型") + private String businessType; + + @ApiModelProperty("截至时间") + @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) + private Date deadline; + + @ApiModelProperty("设备编号") + private String deviceNum; + + @ApiModelProperty("任务名称") + private String taskName; + + @ApiModelProperty("剩余时间") + private String overTime; + + @ApiModelProperty("模块") + private String module; + + @ApiModelProperty("状态") + private String status; + + @ApiModelProperty("设备id") + private String deviceId; + + @ApiModelProperty("设备放置位置") + private String address; + + @ApiModelProperty("设备检查是否需扫码") + private String needScan; + + @ApiModelProperty("审批状态") + private String state; + + @ApiModelProperty(value = "检查人") + private String inspectUser; + + @ApiModelProperty(value = "检查人名称") + private String inspectUserName; + + @ApiModelProperty(value = "整改人") + private String rectifyUser; + + @ApiModelProperty(value = "整改人名称") + private String rectifyUserName; + + @ApiModelProperty(value = "检查时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date inspectTime; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/app/vo/TaskHandInVO.java b/security-service/ht-security/src/main/java/org/security/trans/app/vo/TaskHandInVO.java new file mode 100644 index 0000000..eb6b53c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/app/vo/TaskHandInVO.java @@ -0,0 +1,34 @@ +package org.security.trans.app.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author Create by wzf + * @date 2022/4/24 15:05 + */ +@Data +public class TaskHandInVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 提报机构 + */ + private String deptName; + + /** + * 标题 + */ + private String title; + + /** + * 描述 + */ + private String script; + + /** + * 参加人数 + */ + private Integer joinNumber; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/DutyRecordsController.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/DutyRecordsController.java new file mode 100644 index 0000000..9a17858 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/DutyRecordsController.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import org.security.trans.applyAndReport.dto.DutyRecordsDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.applyAndReport.entity.DutyRecords; +import org.security.trans.applyAndReport.vo.DutyRecordsVO; +import org.security.trans.applyAndReport.service.IDutyRecordsService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 值班备勤表 控制器 + * + * @author BladeX + * @since 2022-07-13 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/dutyrecords") +@Api(value = "值班备勤表", tags = "值班备勤表接口") +public class DutyRecordsController extends BladeController { + + private final IDutyRecordsService dutyRecordsService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入dutyRecords") + public R detail(@PathVariable String id) { + return R.data(dutyRecordsService.getDetailById(id)); + } + + /** + * 分页 值班备勤表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入dutyRecords") + public R> list(DutyRecords dutyRecords, Query query) { + IPage pages = dutyRecordsService.page(Condition.getPage(query), Condition.getQueryWrapper(dutyRecords)); + return R.data(pages); + } + + /** + * 自定义分页 值班备勤表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入dutyRecords") + public R> page(DutyRecordsDTO dutyRecordsDTO, Query query) { + return R.data(dutyRecordsService.selectDutyRecordsPage(dutyRecordsDTO, query)); + } + + /** + * 新增或修改 值班备勤表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增或修改", notes = "传入dutyRecords") + public R save(@Valid @RequestBody DutyRecordsDTO dutyRecords) { + return R.status(dutyRecordsService.saveOrUpdateDutyRecords(dutyRecords)); + } + + /** + * 提交 值班备勤表 + */ + @PostMapping("/handin") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "提交", notes = "传入dutyRecords") + public R handin(@Valid @RequestBody DutyRecordsDTO dutyRecords) { + return R.status(dutyRecordsService.handin(dutyRecords)); + } + + + /** + * 删除 值班备勤表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(dutyRecordsService.removeByIds(Func.toLongList(ids))); + } + + + /** + * 导出值班表 + */ + @PostMapping("/export") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出值班表", notes = "传入ids") + public void exportData(HttpServletResponse httpServletResponse, @RequestParam String ids) { + dutyRecordsService.exportData(httpServletResponse,Func.toStrList(ids)); + } + + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/DutyRecordsLinesController.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/DutyRecordsLinesController.java new file mode 100644 index 0000000..0560d79 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/DutyRecordsLinesController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.applyAndReport.entity.DutyRecordsLines; +import org.security.trans.applyAndReport.vo.DutyRecordsLinesVO; +import org.security.trans.applyAndReport.service.IDutyRecordsLinesService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 控制器 + * + * @author BladeX + * @since 2022-07-13 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/dutyrecordslines") +@Api(value = "", tags = "接口") +public class DutyRecordsLinesController extends BladeController { + + private final IDutyRecordsLinesService dutyRecordsLinesService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入dutyRecordsLines") + public R detail(@PathVariable Long id) { + DutyRecordsLines detail = dutyRecordsLinesService.getById(id); + return R.data(detail); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入dutyRecordsLines") + public R> list(DutyRecordsLines dutyRecordsLines, Query query) { + IPage pages = dutyRecordsLinesService.page(Condition.getPage(query), Condition.getQueryWrapper(dutyRecordsLines)); + return R.data(pages); + } + + /** + * 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入dutyRecordsLines") + public R> page(DutyRecordsLinesVO dutyRecordsLines, Query query) { + IPage pages = dutyRecordsLinesService.selectDutyRecordsLinesPage(Condition.getPage(query), dutyRecordsLines); + return R.data(pages); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入dutyRecordsLines") + public R save(@Valid @RequestBody DutyRecordsLines dutyRecordsLines) { + return R.status(dutyRecordsLinesService.save(dutyRecordsLines)); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入dutyRecordsLines") + public R update(@Valid @RequestBody DutyRecordsLines dutyRecordsLines) { + return R.status(dutyRecordsLinesService.updateById(dutyRecordsLines)); + } + + /** + * 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入dutyRecordsLines") + public R submit(@Valid @RequestBody DutyRecordsLines dutyRecordsLines) { + return R.status(dutyRecordsLinesService.saveOrUpdate(dutyRecordsLines)); + } + + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(dutyRecordsLinesService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/NoteRemindController.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/NoteRemindController.java new file mode 100644 index 0000000..0570581 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/NoteRemindController.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.applyAndReport.dto.NoteRemindDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.applyAndReport.entity.NoteRemind; +import org.security.trans.applyAndReport.vo.NoteRemindVO; +import org.security.trans.applyAndReport.service.INoteRemindService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 便签提醒记录表 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/noteremind") +@Api(value = "便签提醒记录表", tags = "便签提醒记录表接口") +public class NoteRemindController extends BladeController { + + private final INoteRemindService noteRemindService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(noteRemindService.getById(id)); + } + + /** + * 分页 便签提醒记录表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入noteRemind") + public R> list(NoteRemind noteRemind, Query query) { + IPage pages = noteRemindService.page(Condition.getPage(query), Condition.getQueryWrapper(noteRemind)); + return R.data(pages); + } + + /** + * 自定义分页 便签提醒记录表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入noteRemind") + public R> page(NoteRemindDTO noteRemind, Query query) { + IPage pages = noteRemindService.selectNoteRemindPage(Condition.getPage(query), noteRemind); + return R.data(pages); + } + + + /** + * 新增修改 便签提醒记录表 + */ + @PostMapping("/saveOrUpdate") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增修改", notes = "传入noteRemind") + public R saveOrUpdate(@Valid @RequestBody NoteRemind noteRemind) { + return R.status(noteRemindService.saveNoteRemind(noteRemind)); + } + + /** + * 确认提交 便签提醒记录表 + */ + @PostMapping("/handin") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "确认提交", notes = "传入noteRemind") + public R handin(@Valid @RequestBody NoteRemind noteRemind) { + return R.status(noteRemindService.handin(noteRemind)); + } + + + /** + * 删除 便签提醒记录表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(noteRemindService.removeByIds(Func.toLongList(ids))); + } + + /** + * 首页查询分页 便签提醒记录表 + */ + @GetMapping("/todoPage") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "首页查询分页", notes = "传入noteRemind") + public R> todopage(NoteRemindDTO noteRemind, Query query) { + IPage pages = noteRemindService.selectNoteRemindFromOthers(Condition.getPage(query), noteRemind); + return R.data(pages); + } + + /** + * 手动关闭提醒 + */ + @PostMapping("/closeReminder") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "手动关闭提醒", notes = "传入ids") + public R disposal(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return noteRemindService.closeByIds(Func.toLongList(ids)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkFilingController.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkFilingController.java new file mode 100644 index 0000000..b7890a6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkFilingController.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.applyAndReport.dto.WorkFilingDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.applyAndReport.entity.WorkFiling; +import org.security.trans.applyAndReport.vo.WorkFilingVO; +import org.security.trans.applyAndReport.service.IWorkFilingService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 工作报备表 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/workfiling") +@Api(value = "工作报备表", tags = "工作报备表接口") +public class WorkFilingController extends BladeController { + + private final IWorkFilingService workFilingService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(workFilingService.getData(id)); + } + + /** + * 分页 工作报备表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入workFiling") + public R> list(WorkFiling workFiling, Query query) { + IPage pages = workFilingService.page(Condition.getPage(query), Condition.getQueryWrapper(workFiling)); + return R.data(pages); + } + + /** + * 自定义分页 工作报备表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入workFiling") + public R> page(WorkFilingDTO workFiling, Query query) { + IPage pages = workFilingService.selectWorkFilingPage(Condition.getPage(query), workFiling); + return R.data(pages); + } + + /** + * 新增或保存 工作报备表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增或保存", notes = "传入workFiling") + public R save(@Valid @RequestBody WorkFilingDTO workFilingDTO) { + return workFilingService.saveData(workFilingDTO); + } + + + /** + * 提交 工作报备表 + */ + @PostMapping("/handin") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "提交", notes = "传入workFiling") + public R submit(@Valid @RequestBody WorkFilingDTO workFiling) { + return workFilingService.handin(workFiling); + } + + + /** + * 删除 工作报备表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(workFilingService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkOvertimeReportingController.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkOvertimeReportingController.java new file mode 100644 index 0000000..1329ba7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkOvertimeReportingController.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.applyAndReport.dto.WorkOvertimeReportingDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.applyAndReport.entity.WorkOvertimeReporting; +import org.security.trans.applyAndReport.vo.WorkOvertimeReportingVO; +import org.security.trans.applyAndReport.service.IWorkOvertimeReportingService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 加班记录报备表 控制器 + * + * @author BladeX + * @since 2022-07-13 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/workovertimereporting") +@Api(value = "加班记录报备表", tags = "加班记录报备表接口") +public class WorkOvertimeReportingController extends BladeController { + + private final IWorkOvertimeReportingService workOvertimeReportingService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入workOvertimeReporting") + public R detail(@PathVariable String id) { + return R.data(workOvertimeReportingService.getDetailById(id)); + } + + /** + * 分页 加班记录报备表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入workOvertimeReporting") + public R> list(WorkOvertimeReporting workOvertimeReporting, Query query) { + IPage pages = workOvertimeReportingService.page(Condition.getPage(query), Condition.getQueryWrapper(workOvertimeReporting)); + return R.data(pages); + } + + /** + * 自定义分页 加班记录报备表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入workOvertimeReporting") + public R> page(WorkOvertimeReportingDTO workOvertimeReportingDTO, Query query) { + return R.data(workOvertimeReportingService.selectWorkOvertimeReportingPage(workOvertimeReportingDTO, query)); + } + + /** + * 暂存 加班记录报备表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "暂存", notes = "传入workOvertimeReporting") + public R save(@Valid @RequestBody WorkOvertimeReportingDTO workOvertimeReporting) { + return R.status(workOvertimeReportingService.saveOrUpdateWorkOvertime(workOvertimeReporting)); + } + + /** + * 提交 加班记录报备表 + */ + @PostMapping("/handin") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "提交", notes = "传入workOvertimeReporting") + public R handin(@Valid @RequestBody WorkOvertimeReportingDTO workOvertimeReporting) { + return R.status(workOvertimeReportingService.handin(workOvertimeReporting)); + } + + + /** + * 删除 加班记录报备表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(workOvertimeReportingService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkOvertimeReportingLinesController.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkOvertimeReportingLinesController.java new file mode 100644 index 0000000..c6536e8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/controller/WorkOvertimeReportingLinesController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.applyAndReport.entity.WorkOvertimeReportingLines; +import org.security.trans.applyAndReport.vo.WorkOvertimeReportingLinesVO; +import org.security.trans.applyAndReport.service.IWorkOvertimeReportingLinesService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 加班记录报备人员信息表 控制器 + * + * @author BladeX + * @since 2022-07-13 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/workovertimereportinglines") +@Api(value = "加班记录报备人员信息表", tags = "加班记录报备人员信息表接口") +public class WorkOvertimeReportingLinesController extends BladeController { + + private final IWorkOvertimeReportingLinesService workOvertimeReportingLinesService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入workOvertimeReportingLines") + public R detail(@PathVariable Long id) { + WorkOvertimeReportingLines detail = workOvertimeReportingLinesService.getById(id); + return R.data(detail); + } + + /** + * 分页 加班记录报备人员信息表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入workOvertimeReportingLines") + public R> list(WorkOvertimeReportingLines workOvertimeReportingLines, Query query) { + IPage pages = workOvertimeReportingLinesService.page(Condition.getPage(query), Condition.getQueryWrapper(workOvertimeReportingLines)); + return R.data(pages); + } + + /** + * 自定义分页 加班记录报备人员信息表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入workOvertimeReportingLines") + public R> page(WorkOvertimeReportingLinesVO workOvertimeReportingLines, Query query) { + IPage pages = workOvertimeReportingLinesService.selectWorkOvertimeReportingLinesPage(Condition.getPage(query), workOvertimeReportingLines); + return R.data(pages); + } + + /** + * 新增 加班记录报备人员信息表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入workOvertimeReportingLines") + public R save(@Valid @RequestBody WorkOvertimeReportingLines workOvertimeReportingLines) { + return R.status(workOvertimeReportingLinesService.save(workOvertimeReportingLines)); + } + + /** + * 修改 加班记录报备人员信息表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入workOvertimeReportingLines") + public R update(@Valid @RequestBody WorkOvertimeReportingLines workOvertimeReportingLines) { + return R.status(workOvertimeReportingLinesService.updateById(workOvertimeReportingLines)); + } + + /** + * 新增或修改 加班记录报备人员信息表 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入workOvertimeReportingLines") + public R submit(@Valid @RequestBody WorkOvertimeReportingLines workOvertimeReportingLines) { + return R.status(workOvertimeReportingLinesService.saveOrUpdate(workOvertimeReportingLines)); + } + + + /** + * 删除 加班记录报备人员信息表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(workOvertimeReportingLinesService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/DutyRecordsDTO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/DutyRecordsDTO.java new file mode 100644 index 0000000..dcf5bd5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/DutyRecordsDTO.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.dto; + +import io.swagger.annotations.ApiModelProperty; +import org.security.trans.applyAndReport.entity.DutyRecords; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.applyAndReport.entity.DutyRecordsLines; + +import java.util.List; + +/** + * 值班记录表数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DutyRecordsDTO extends DutyRecords { + private static final long serialVersionUID = 1L; + List dutyRecordsLinesList; + @ApiModelProperty(value = "统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级)") + private String includeChildren; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/DutyRecordsLinesDTO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/DutyRecordsLinesDTO.java new file mode 100644 index 0000000..ab02c2c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/DutyRecordsLinesDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.dto; + +import org.security.trans.applyAndReport.entity.DutyRecordsLines; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DutyRecordsLinesDTO extends DutyRecordsLines { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/NoteRemindDTO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/NoteRemindDTO.java new file mode 100644 index 0000000..32dea06 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/NoteRemindDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.dto; + +import org.security.trans.applyAndReport.entity.NoteRemind; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 便签提醒记录表数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class NoteRemindDTO extends NoteRemind { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkFilingDTO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkFilingDTO.java new file mode 100644 index 0000000..8171dbd --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkFilingDTO.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.dto; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.applyAndReport.entity.WorkFiling; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 工作报备表数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class WorkFilingDTO extends WorkFiling { + private static final long serialVersionUID = 1L; + // 查询人userId + String queryUserId; + private List fileList; + @ApiModelProperty(value = "统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级)") + private String includeChildren; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkOvertimeReportingDTO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkOvertimeReportingDTO.java new file mode 100644 index 0000000..f63837b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkOvertimeReportingDTO.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.dto; + +import org.security.trans.applyAndReport.entity.WorkOvertimeReporting; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.applyAndReport.entity.WorkOvertimeReportingLines; + +import java.util.List; + +/** + * 加班记录报备表数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class WorkOvertimeReportingDTO extends WorkOvertimeReporting { + private static final long serialVersionUID = 1L; + List workOvertimeLinesList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkOvertimeReportingLinesDTO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkOvertimeReportingLinesDTO.java new file mode 100644 index 0000000..f791165 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/dto/WorkOvertimeReportingLinesDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.dto; + +import org.security.trans.applyAndReport.entity.WorkOvertimeReportingLines; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 加班记录报备人员信息表数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class WorkOvertimeReportingLinesDTO extends WorkOvertimeReportingLines { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/DutyRecords.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/DutyRecords.java new file mode 100644 index 0000000..3fe8fc5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/DutyRecords.java @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.FlowEntity; + +/** + * 值班记录表实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@TableName("T_DUTY_RECORDS") +@ApiModel(value = "DutyRecords对象", description = "值班记录表") +public class DutyRecords extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 机构代码 + */ + @ApiModelProperty(value = "机构代码") + @TableField("ORGANIZATION_CODE") + private String organizationCode; + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @TableField("ORGANIZATION_NAME") + private String organizationName; + /** + * 值班事项说明 + */ + @ApiModelProperty(value = "值班事项说明") + @TableField("DESCRIPTION") + private String description; + /** + * 值班开始时间 + */ + @ApiModelProperty(value = "值班开始时间") + @TableField("START_TIME") + private Date startTime; + /** + * 值班结束时间 + */ + @ApiModelProperty(value = "值班结束时间") + @TableField("END_TIME") + private Date endTime; + /** + * 值班负责人 + */ + @ApiModelProperty(value = "值班负责人") + @TableField("PERSON_IN_CHARGE") + private String personInCharge; + /** + * 值班负责人电话 + */ + @ApiModelProperty(value = "值班负责人电话") + @TableField("TELEPHONE") + private String telephone; + /** + * 带班领导 + */ + @ApiModelProperty(value = "带班领导") + @TableField("SHIFT_LEADER") + private String shiftLeader; + /** + * 带班领导电话 + */ + @ApiModelProperty(value = "带班领导电话") + @TableField("LEADER_TELEPHONE") + private String leaderTelephone; + /** + * 安保值班人员 + */ + @ApiModelProperty(value = "安保值班人员") + @TableField("SECURITY_WATCHMAN") + private String securityWatchman; + /** + * 安保值班人员电话 + */ + @ApiModelProperty(value = "安保值班人员电话") + @TableField("SECURITY_WATCHMAN_TELEPHONE") + private String securityWatchmanTelephone; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 状态;0-待提交审批、1-审批中、2-审批完成、3-审批驳回 + */ + @ApiModelProperty(value = "状态;0-待提交审批、1-审批中、2-审批完成、3-审批驳回") + @TableField("STATE") + private String state; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 类型;1-工作日,2-非工作日 + */ + @ApiModelProperty(value = "类型;1-工作日,2-非工作日") + @TableField("TYPE") + private String type; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/DutyRecordsLines.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/DutyRecordsLines.java new file mode 100644 index 0000000..4d5cbe7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/DutyRecordsLines.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@TableName("T_DUTY_RECORDS_LINES") +@ApiModel(value = "DutyRecordsLines对象", description = "DutyRecordsLines对象") +public class DutyRecordsLines extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 值班表ID + */ + @ApiModelProperty(value = "值班表ID") + @TableField("FORM_ID") + private String formId; + /** + * 值班人员 + */ + @ApiModelProperty(value = "值班人员") + @TableField("PERSON") + private String person; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + @TableField("PHONE") + private String phone; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/NoteRemind.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/NoteRemind.java new file mode 100644 index 0000000..c0787eb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/NoteRemind.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 便签提醒记录表实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_NOTE_REMIND") +@ApiModel(value = "NoteRemind对象", description = "便签提醒记录表") +public class NoteRemind extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 便签提醒主题/提示事项 + */ + @ApiModelProperty(value = "提示事项") + @TableField("NOTE_TITLE") + private String noteTitle; + /** + * 工作内容描述 + */ + @ApiModelProperty(value = "工作内容描述") + @TableField("NOTE_CONTENT") + private String noteContent; + /** + * 提示开始时间 + */ + @ApiModelProperty(value = "提示开始时间") + @TableField("START_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startTime; + /** + * 提示结束时间 + */ + @ApiModelProperty(value = "提示结束时间") + @TableField("END_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endTime; + /** + * 便签提醒时间间隔(结束时间多少个小时)单位:小时 + */ + @ApiModelProperty(value = "便签提醒时间间隔 单位:小时") + @TableField("ALARM_TIME") + private BigDecimal alarmTime; + /** + * 记录创建人部门id + */ + @ApiModelProperty(value = "记录创建人部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 记录创建人部门名称 + */ + @ApiModelProperty(value = "记录创建人部门名称") + @TableField("DEPT_NAME") + private String deptName; + /** + * 接收部门id + */ + @ApiModelProperty(value = "接收部门id") + @TableField("RECEIVE_DEPT") + private String receiveDept; + /** + * 接收用户id + */ + @ApiModelProperty(value = "接收用户id") + @TableField("RECEIVE_USERS") + private String receiveUsers; + /** + * 逻辑删除;(0-正常,1-删除) + */ + @ApiModelProperty(value = "逻辑删除;(0-正常,1-删除)") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 用于展示接收部门级联选择 + */ + @ApiModelProperty(value = "用于展示接收部门级联选择") + @TableField("RECEIVE_DEPT_FRONT") + private String receiveDeptFront; + /** + * 状态 0-待提交(不会进行定期提醒) 1-已提交(会进行定期提醒) 2-已完成(用户完成工作后主动关闭提醒) + * 3-已到期(任务到提醒期限,此后定时任务不再进行提醒) + */ + @ApiModelProperty(value = "状态") + @TableField("STATE") + private String state; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkFiling.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkFiling.java new file mode 100644 index 0000000..a314c49 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkFiling.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 工作报备表实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_WORK_FILING") +@ApiModel(value = "WorkFiling对象", description = "工作报备表") +public class WorkFiling extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 事项名称 + */ + @ApiModelProperty(value = "事项名称") + @TableField("NAME") + private String name; + /** + * 事项说明 + */ + @ApiModelProperty(value = "事项说明") + @TableField("DESCRIPTION") + private String description; + /** + * 计划开始时间 + */ + @ApiModelProperty(value = "计划开始时间") + @TableField("START_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startDate; + /** + * 计划结束时间 + */ + @ApiModelProperty(value = "计划结束时间") + @TableField("END_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endDate; + /** + * 申请资源说明 + */ + @ApiModelProperty(value = "申请资源说明") + @TableField("SOURCE_APPLY") + private String sourceApply; + /** + * 状态;0-待提交、1-待审批、2-审批完成 + */ + @ApiModelProperty(value = "状态;0-待提交、1-待审批、2-审批完成") + @TableField("STATE") + private String state; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + + /** + * 部门名称 + */ + @ApiModelProperty(value = "部门名称") + @TableField("DEPT_NAME") + private String deptName; + + /** + * 报备对象userId + */ + @ApiModelProperty(value = "报备对象userId") + @TableField("RECEIVE_USER_ID") + private String receiveUserId; + + /** + * 附件相关标识符 + */ + @ApiModelProperty(value = "附件相关标识符") + @TableField("group_name") + private String groupName; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkOvertimeReporting.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkOvertimeReporting.java new file mode 100644 index 0000000..3b4650b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkOvertimeReporting.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 加班记录报备表实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@TableName("T_WORK_OVERTIME_REPORTING") +@ApiModel(value = "WorkOvertimeReporting对象", description = "加班记录报备表") +public class WorkOvertimeReporting extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 机构代码 + */ + @ApiModelProperty(value = "机构代码") + @TableField("ORGANIZATION_CODE") + private String organizationCode; + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @TableField("ORGANIZATION_NAME") + private String organizationName; + /** + * 加班计划开始时间 + */ + @ApiModelProperty(value = "加班计划开始时间") + @TableField("PLAN_START_TIME") + private LocalDateTime planStartTime; + /** + * 加班计划结束时间 + */ + @ApiModelProperty(value = "加班计划结束时间") + @TableField("PLAN_END_TIME") + private LocalDateTime planEndTime; + /** + * 实际加班开始时间 + */ + @ApiModelProperty(value = "实际加班开始时间") + @TableField("ACTUAL_START_TIME") + private LocalDateTime actualStartTime; + /** + * 实际加班结束时间 + */ + @ApiModelProperty(value = "实际加班结束时间") + @TableField("ACTUAL_END_TIME") + private String actualEndTime; + /** + * 加班地点 + */ + @ApiModelProperty(value = "加班地点") + @TableField("PLACE") + private String place; + /** + * 状态;0-待提交、1-待审批、2-待确认、3-确认完毕 + */ + @ApiModelProperty(value = "状态;0-待提交、1-待审批、2-待确认、3-确认完毕") + @TableField("STATE") + private String state; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 加班事项说明 + */ + @ApiModelProperty(value = "加班事项说明") + @TableField("DESCRIPTION") + private String description; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkOvertimeReportingLines.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkOvertimeReportingLines.java new file mode 100644 index 0000000..07bc3f8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/entity/WorkOvertimeReportingLines.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 加班记录报备人员信息表实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@TableName("T_WORK_OVERTIME_REPORTING_LINES") +@ApiModel(value = "WorkOvertimeReportingLines对象", description = "加班记录报备人员信息表") +public class WorkOvertimeReportingLines extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 加班报备信息记录关联id + */ + @ApiModelProperty(value = "加班报备信息记录关联id") + @TableField("FORM_ID") + private String formId; + /** + * 加班人员 + */ + @ApiModelProperty(value = "加班人员") + @TableField("PERSON") + private String person; + /** + * 加班人员电话 + */ + @ApiModelProperty(value = "加班人员电话") + @TableField("PHONE") + private String phone; + /** + * 加班地点 + */ + @ApiModelProperty(value = "加班地点") + @TableField("PLACE") + private String place; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsLinesMapper.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsLinesMapper.java new file mode 100644 index 0000000..195ccc8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsLinesMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.mapper; + +import org.security.trans.applyAndReport.entity.DutyRecordsLines; +import org.security.trans.applyAndReport.vo.DutyRecordsLinesVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * Mapper 接口 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface DutyRecordsLinesMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param dutyRecordsLines + * @return + */ + List selectDutyRecordsLinesPage(IPage page, DutyRecordsLinesVO dutyRecordsLines); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsLinesMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsLinesMapper.xml new file mode 100644 index 0000000..ce5367b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsLinesMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsMapper.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsMapper.java new file mode 100644 index 0000000..8a3d7b3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.mapper; + +import org.security.trans.applyAndReport.entity.DutyRecords; +import org.security.trans.applyAndReport.vo.DutyRecordsVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 值班记录表 Mapper 接口 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface DutyRecordsMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param dutyRecords + * @return + */ + List selectDutyRecordsPage(IPage page, DutyRecordsVO dutyRecords); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsMapper.xml new file mode 100644 index 0000000..01b1bbf --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/DutyRecordsMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/NoteRemindMapper.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/NoteRemindMapper.java new file mode 100644 index 0000000..028a9f6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/NoteRemindMapper.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.applyAndReport.dto.NoteRemindDTO; +import org.security.trans.applyAndReport.entity.NoteRemind; +import org.security.trans.applyAndReport.vo.NoteRemindVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.Date; +import java.util.List; + +/** + * 便签提醒记录表 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface NoteRemindMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param noteRemindDTO + * @return + */ + @DataAuth(type = DataScopeEnum.OWN, column = "CREATED_BY") + List selectNoteRemindPage(IPage page, NoteRemindDTO noteRemindDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/NoteRemindMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/NoteRemindMapper.xml new file mode 100644 index 0000000..ddb0498 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/NoteRemindMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkFilingMapper.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkFilingMapper.java new file mode 100644 index 0000000..bc0370a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkFilingMapper.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.mapper; + +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.security.system.user.vo.UserVO; +import org.security.trans.applyAndReport.dto.WorkFilingDTO; +import org.security.trans.applyAndReport.entity.WorkFiling; +import org.security.trans.applyAndReport.vo.WorkFilingVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.sql.Wrapper; +import java.util.List; + +/** + * 工作报备表 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface WorkFilingMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param workFiling + * @return + */ + List selectWorkFilingList(IPage page, WorkFilingDTO workFiling,@Param("aimDepts") List aimDepts); + + UserVO getUserById(@Param("userId") String userId); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkFilingMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkFilingMapper.xml new file mode 100644 index 0000000..8fda595 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkFilingMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingLinesMapper.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingLinesMapper.java new file mode 100644 index 0000000..f0afb4c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingLinesMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.mapper; + +import org.security.trans.applyAndReport.entity.WorkOvertimeReportingLines; +import org.security.trans.applyAndReport.vo.WorkOvertimeReportingLinesVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 加班记录报备人员信息表 Mapper 接口 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface WorkOvertimeReportingLinesMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param workOvertimeReportingLines + * @return + */ + List selectWorkOvertimeReportingLinesPage(IPage page, WorkOvertimeReportingLinesVO workOvertimeReportingLines); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingLinesMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingLinesMapper.xml new file mode 100644 index 0000000..c71e32d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingLinesMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingMapper.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingMapper.java new file mode 100644 index 0000000..4d226cc --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.mapper; + +import org.security.trans.applyAndReport.entity.WorkOvertimeReporting; +import org.security.trans.applyAndReport.vo.WorkOvertimeReportingVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 加班记录报备表 Mapper 接口 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface WorkOvertimeReportingMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param workOvertimeReporting + * @return + */ + List selectWorkOvertimeReportingPage(IPage page, WorkOvertimeReportingVO workOvertimeReporting); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingMapper.xml new file mode 100644 index 0000000..dc3a69a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/mapper/WorkOvertimeReportingMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IDutyRecordsLinesService.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IDutyRecordsLinesService.java new file mode 100644 index 0000000..0cc03f6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IDutyRecordsLinesService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service; + +import org.security.trans.applyAndReport.entity.DutyRecordsLines; +import org.security.trans.applyAndReport.vo.DutyRecordsLinesVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 服务类 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface IDutyRecordsLinesService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param dutyRecordsLines + * @return + */ + IPage selectDutyRecordsLinesPage(IPage page, DutyRecordsLinesVO dutyRecordsLines); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IDutyRecordsService.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IDutyRecordsService.java new file mode 100644 index 0000000..a7000d8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IDutyRecordsService.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service; + +import org.security.trans.applyAndReport.dto.DutyRecordsDTO; +import org.security.trans.applyAndReport.entity.DutyRecords; +import org.security.trans.applyAndReport.vo.DutyRecordsVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.common.service.FlowableService; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 值班记录表 服务类 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface IDutyRecordsService extends FlowableService { + + /** + * 自定义分页 + * + * @param query + * @param dutyRecordsDTO + * @return + */ + IPage selectDutyRecordsPage(DutyRecordsDTO dutyRecordsDTO, Query query); + + /** + * 新增或修改暂存 + * @param dutyRecords + * @return + */ + boolean saveOrUpdateDutyRecords(DutyRecordsDTO dutyRecords); + + /** + * 查询详情 + * @param id + * @return + */ + DutyRecordsVO getDetailById(String id); + + /** + * 提交 + * @param dutyRecords + * @return + */ + boolean handin(DutyRecordsDTO dutyRecords); + + /** + * 导出值班记录 + * + * @param httpServletResponse + * @param idList 导出目标数据 + */ + void exportData(HttpServletResponse httpServletResponse, List idList); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/INoteRemindService.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/INoteRemindService.java new file mode 100644 index 0000000..110f92a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/INoteRemindService.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service; + +import org.security.trans.applyAndReport.dto.NoteRemindDTO; +import org.security.trans.applyAndReport.entity.NoteRemind; +import org.security.trans.applyAndReport.vo.NoteRemindVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.tool.api.R; + +import java.util.List; + +/** + * 便签提醒记录表 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface INoteRemindService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param noteRemind + * @return + */ + IPage selectNoteRemindPage(IPage page, NoteRemindDTO noteRemind); + + IPage selectNoteRemindFromOthers(IPage page, NoteRemindDTO noteRemind); + + /** + * 新增或修改 + * @param noteRemind + * @return + */ + boolean saveNoteRemind(NoteRemind noteRemind); + + /** + * 确认提交 + * @param noteRemind + * @return + */ + boolean handin(NoteRemind noteRemind); + /** + * 手动关闭提醒 + * @param toLongList ids + * @return + */ + R closeByIds(List toLongList); + /** + * 查询当前正在提醒中的工作提醒 + */ + List getUsingList(); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkFilingService.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkFilingService.java new file mode 100644 index 0000000..5272c11 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkFilingService.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service; + +import org.security.trans.applyAndReport.dto.WorkFilingDTO; +import org.security.trans.applyAndReport.entity.WorkFiling; +import org.security.trans.applyAndReport.vo.WorkFilingVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.tool.api.R; + +/** + * 工作报备表 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface IWorkFilingService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param workFiling + * @return + */ + IPage selectWorkFilingPage(IPage page, WorkFilingDTO workFiling); + + /** + * 提交审批 + * + * @param workFiling + * @return + */ + R handin(WorkFilingDTO workFiling); + + R saveData(WorkFilingDTO workFilingDTO); + + + WorkFilingVO getData(String id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkOvertimeReportingLinesService.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkOvertimeReportingLinesService.java new file mode 100644 index 0000000..fc6b6a3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkOvertimeReportingLinesService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service; + +import org.security.trans.applyAndReport.entity.WorkOvertimeReportingLines; +import org.security.trans.applyAndReport.vo.WorkOvertimeReportingLinesVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 加班记录报备人员信息表 服务类 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface IWorkOvertimeReportingLinesService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param workOvertimeReportingLines + * @return + */ + IPage selectWorkOvertimeReportingLinesPage(IPage page, WorkOvertimeReportingLinesVO workOvertimeReportingLines); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkOvertimeReportingService.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkOvertimeReportingService.java new file mode 100644 index 0000000..2406e5d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/IWorkOvertimeReportingService.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service; + +import org.security.trans.applyAndReport.dto.WorkOvertimeReportingDTO; +import org.security.trans.applyAndReport.entity.WorkOvertimeReporting; +import org.security.trans.applyAndReport.vo.WorkOvertimeReportingVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import org.springblade.core.mp.support.Query; + +/** + * 加班记录报备表 服务类 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface IWorkOvertimeReportingService extends IService { + + /** + * 自定义分页 + * + * @param query + * @param workOvertimeReportingDTO + * @return + */ + IPage selectWorkOvertimeReportingPage(WorkOvertimeReportingDTO workOvertimeReportingDTO, Query query); + + boolean saveOrUpdateWorkOvertime(WorkOvertimeReportingDTO workOvertimeReportingDTO); + + boolean handin(WorkOvertimeReportingDTO workOvertimeReportingDTO); + + WorkOvertimeReportingVO getDetailById(String id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/DutyRecordsLinesServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/DutyRecordsLinesServiceImpl.java new file mode 100644 index 0000000..0352278 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/DutyRecordsLinesServiceImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service.impl; + +import org.security.trans.applyAndReport.entity.DutyRecordsLines; +import org.security.trans.applyAndReport.vo.DutyRecordsLinesVO; +import org.security.trans.applyAndReport.mapper.DutyRecordsLinesMapper; +import org.security.trans.applyAndReport.service.IDutyRecordsLinesService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 服务实现类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Service +public class DutyRecordsLinesServiceImpl extends ServiceImpl implements IDutyRecordsLinesService { + + @Override + public IPage selectDutyRecordsLinesPage(IPage page, DutyRecordsLinesVO dutyRecordsLines) { + return page.setRecords(baseMapper.selectDutyRecordsLinesPage(page, dutyRecordsLines)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/DutyRecordsServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/DutyRecordsServiceImpl.java new file mode 100644 index 0000000..3c0c6a7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/DutyRecordsServiceImpl.java @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.security.common.Constant; +import org.security.common.util.ExcelUtil; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.feign.ISysClient; +import org.security.trans.applyAndReport.dto.DutyRecordsDTO; +import org.security.trans.applyAndReport.entity.DutyRecords; +import org.security.trans.applyAndReport.entity.DutyRecordsLines; +import org.security.trans.applyAndReport.service.IDutyRecordsLinesService; +import org.security.trans.applyAndReport.vo.DutyRecordsVO; +import org.security.trans.applyAndReport.mapper.DutyRecordsMapper; +import org.security.trans.applyAndReport.service.IDutyRecordsService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.applyAndReport.vo.ExportRecordsVO; +import org.security.trans.basic.service.IEmployeeService; +import org.security.trans.common.service.IFileService; +import org.security.trans.dataStatistics.service.impl.InspectionDataServiceImpl; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; + +import static org.security.common.Constant.DELETE_FLAG_0; + +/** + * 值班记录表 服务实现类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Service +@AllArgsConstructor +@Slf4j +public class DutyRecordsServiceImpl extends ServiceImpl implements IDutyRecordsService { + private final IDutyRecordsLinesService dutyRecordsLinesService; + private final IFlowClient flowClient; + private final ISysClient sysClient; + private final IEmployeeService employeeService; + private final IFileService fileService; + private final InspectionDataServiceImpl inspectionDataService; + + /** + * 查询分页信息 + * + * @param dutyRecordsDTO + * @param query + * @return + */ + @Override + public IPage selectDutyRecordsPage(DutyRecordsDTO dutyRecordsDTO, Query query) { + String deptId = Func.isNotEmpty(dutyRecordsDTO.getOrganizationCode())?dutyRecordsDTO.getOrganizationCode():AuthUtil.getDeptId(); + List aimDepts = inspectionDataService.setDeptIds(deptId, dutyRecordsDTO.getIncludeChildren()); + IPage page = Condition.getPage(query); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .in(Func.isNotEmpty(aimDepts), DutyRecords::getOrganizationCode, aimDepts) + .eq(StringUtils.isNotBlank(dutyRecordsDTO.getType()), DutyRecords::getType, dutyRecordsDTO.getType()) + .orderByDesc(DutyRecords::getCreatedTime) + .orderByDesc(DutyRecords::getUpdatedTime); + IPage iPage = this.page(page, queryWrapper); + IPage res = new Page<>(); + List Dvos = BeanUtil.copyProperties(iPage.getRecords(), DutyRecordsVO.class); + if(Dvos.size()>0){ + Dvos.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + res.setTotal(iPage.getTotal()); + res.setSize(iPage.getSize()); + res.setCurrent(iPage.getCurrent()); + res.setRecords(Dvos); + return res; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveOrUpdateDutyRecords(DutyRecordsDTO dutyRecordsDTO) { + DutyRecords dutyRecords = Func.copy(dutyRecordsDTO, DutyRecords.class); + dutyRecords.setState(Constant.HANDIN_STATE_DRAFT); + this.saveOrUpdate(dutyRecords); + //明细表信息 + List dutyRecordsLinesList = dutyRecordsDTO.getDutyRecordsLinesList(); + if (Func.isNotEmpty(dutyRecordsLinesList)) { + dutyRecordsLinesList.forEach(item -> { + item.setFormId(dutyRecords.getId()); + }); + //更新明细表数据 + dutyRecordsLinesService.saveOrUpdateBatch(dutyRecordsLinesList); + } + return this.saveOrUpdate(dutyRecords); + } + + @Override + public boolean handin(DutyRecordsDTO dutyRecordsDTO) { + DutyRecords dutyRecords = Func.copy(dutyRecordsDTO, DutyRecords.class); + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.DUTY_RECORDS_KEY); + if (definitionRes.isSuccess()) { + dutyRecords.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("流程模型未定义"); + } + dutyRecords.setState(Constant.HANDIN_STATE_AUDIT); + this.saveOrUpdate(dutyRecords); + + String businessTable = FlowUtil.getBusinessTable(DutyRecords.class); + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, dutyRecords.getId()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + if (1 == deptCategory.getData()) { + variables.set(ProcessConstant.PASS_KEY, true); + } + R result = flowClient.startProcessInstanceById(dutyRecords.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(dutyRecords.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + DutyRecords afterStartRecords = this.getById(dutyRecords.getId()); + // 返回流程id写入dutyRecords + afterStartRecords.setProcessInstanceId(result.getData().getProcessInstanceId()); + + //明细表信息 + List dutyRecordsLinesList = dutyRecordsDTO.getDutyRecordsLinesList(); + if (Func.isNotEmpty(dutyRecordsLinesList)) { + dutyRecordsLinesList.forEach(item -> { + item.setFormId(afterStartRecords.getId()); + }); + //更新明细表数据 + dutyRecordsLinesService.saveOrUpdateBatch(dutyRecordsLinesList); + } + updateById(afterStartRecords); + return true; + } else { + throw new ServiceException("开启流程失败"); + } + } + + @Override + public void exportData(HttpServletResponse httpServletResponse, List idList) { + log.info("---------------值班备勤导出开始---------------"); + List list; + //导出用户选中数据 + if (Func.isNotEmpty(idList) && idList.size() > 0) { + list = this.list(new QueryWrapper().lambda().in(DutyRecords::getId, idList)); + }//用户不选择任何数据,则导出该登录用户所属机构的值班数据 + else { + list = this.list(new QueryWrapper().lambda().eq(DutyRecords::getDeptId, AuthUtil.getDeptId())); + } + //获取相关值班人员明细 + if (Func.isNotEmpty(list)) { + log.info("值班备勤导出数据:[{}]",list); + List vos = new ArrayList<>(); + list.forEach(item -> { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + ExportRecordsVO vo = Func.copy(item, ExportRecordsVO.class); + vo.setStartTime(format.format(item.getStartTime())); + vo.setEndTime(format.format(item.getEndTime())); + vo.setType("1".equals(vo.getType()) ? "工作日" : "非工作日"); + vo.setPersonInCharge(employeeService.getById(item.getPersonInCharge()).getName()); + List lines = dutyRecordsLinesService.list(new QueryWrapper().lambda().eq(DutyRecordsLines::getFormId, item.getId())); + List personnelOnDuties = new ArrayList<>(); + if (Func.isNotEmpty(lines)) { + lines.forEach(line -> { + line.setPerson(employeeService.getById(line.getPerson()).getName()); + personnelOnDuties.add(line.getPerson().concat("-").concat(line.getPhone())); + }); + } + vo.setPersonnelOnDuties(Func.join(personnelOnDuties).replace(",","\n")); + vos.add(vo); + }); + //导出excel + ExcelUtil.export(httpServletResponse, "值班备勤表", "sheet1", vos, ExportRecordsVO.class); + log.info("---------------值班备勤导出结束---------------"); + } + } + + @Override + public DutyRecordsVO getDetailById(String id) { + DutyRecords dutyRecords = super.getById(id); + DutyRecordsVO dutyRecordsVO = Func.copy(dutyRecords, DutyRecordsVO.class); + //获取明细信息 + List lineList = dutyRecordsLinesService.list(new QueryWrapper().eq("FORM_ID", id)); + if (Func.isNotEmpty(lineList)) { + dutyRecordsVO.setDutyRecordsLinesList(lineList); + } + return dutyRecordsVO; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/NoteRemindServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/NoteRemindServiceImpl.java new file mode 100644 index 0000000..d64bfb5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/NoteRemindServiceImpl.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.trans.applyAndReport.dto.NoteRemindDTO; +import org.security.trans.applyAndReport.entity.NoteRemind; +import org.security.trans.applyAndReport.vo.NoteRemindVO; +import org.security.trans.applyAndReport.mapper.NoteRemindMapper; +import org.security.trans.applyAndReport.service.INoteRemindService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import static org.security.common.Constant.*; + +/** + * 便签提醒记录表 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Service +@AllArgsConstructor +public class NoteRemindServiceImpl extends ServiceImpl implements INoteRemindService { + private final IDepartmentService departmentService; + private final IFileService fileService; + + @Override + public IPage selectNoteRemindPage(IPage page, NoteRemindDTO noteRemind) { + List vos = baseMapper.selectNoteRemindPage(page, noteRemind); + if(Func.isNotEmpty(vos)){ + vos.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + return page.setRecords(vos); + } + + @Override + public IPage selectNoteRemindFromOthers(IPage page, NoteRemindDTO noteRemind) { + if (Func.isEmpty(noteRemind.getReceiveUsers())) { + noteRemind.setReceiveUsers(String.valueOf(AuthUtil.getUserId())); + } + List list = this.list(new QueryWrapper().lambda() + .eq(NoteRemind::getDelFlag, Constant.DELETE_FLAG_0) + .eq(NoteRemind::getState, REMINDER_STATE_SUBMIT) + .like(Func.isNotEmpty(noteRemind.getReceiveUsers()), NoteRemind::getReceiveUsers, noteRemind.getReceiveUsers()) + .gt(NoteRemind::getEndTime, new Date()) + .le(NoteRemind::getStartTime, new Date()) + .orderByAsc(NoteRemind::getEndTime) + .orderByDesc(NoteRemind::getCreatedTime).orderByDesc(NoteRemind::getUpdatedTime)); + return page.setRecords(Func.copy(list, NoteRemindVO.class)); + } + + @Override + public boolean saveNoteRemind(NoteRemind noteRemind) { + if (Func.isBlank(noteRemind.getDeptId())) { + noteRemind.setDeptId(AuthUtil.getDeptId()); + } + noteRemind.setDeptName(departmentService.getById(noteRemind.getDeptId()).getDeptName()); + return saveOrUpdate(noteRemind); + } + + @Override + public boolean handin(NoteRemind noteRemind) { + if (Func.isBlank(noteRemind.getDeptId())) { + noteRemind.setDeptId(AuthUtil.getDeptId()); + } + noteRemind.setDeptName(departmentService.getById(noteRemind.getDeptId()).getDeptName()); + noteRemind.setState(REMINDER_STATE_SUBMIT); + return saveOrUpdate(noteRemind); + } + + @Override + public R closeByIds(List toLongList) { + ArrayList list = new ArrayList<>(); + if (Func.isNotEmpty(toLongList)) { + toLongList.forEach(item -> { + //根据id获取工作提醒信息 + NoteRemind noteRemind = this.getById(item); + list.add(noteRemind); + }); + } + if (Func.isNotEmpty(list)) { + list.forEach(item -> { + item.setState(REMINDER_STATE_DONE); + }); + } + return R.status(this.saveOrUpdateBatch(list)); + } + + @Override + public List getUsingList(){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("STATE", REMINDER_STATE_SUBMIT); + queryWrapper.eq("DEL_FLAG",Constant.DELETE_FLAG_0); + return baseMapper.selectList(queryWrapper); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkFilingServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkFilingServiceImpl.java new file mode 100644 index 0000000..4f4bc59 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkFilingServiceImpl.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.desk.feign.IXYunClient; +import org.security.system.user.vo.UserVO; +import org.security.trans.applyAndReport.dto.WorkFilingDTO; +import org.security.trans.applyAndReport.entity.WorkFiling; +import org.security.trans.applyAndReport.vo.WorkFilingVO; +import org.security.trans.applyAndReport.mapper.WorkFilingMapper; +import org.security.trans.applyAndReport.service.IWorkFilingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.trans.dataStatistics.service.impl.InspectionDataServiceImpl; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * 工作报备表 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Slf4j +@Service +@AllArgsConstructor +public class WorkFilingServiceImpl extends ServiceImpl implements IWorkFilingService { + + private final IFileService fileService; + private final IXYunClient xYunClient; + private final InspectionDataServiceImpl inspectionDataService; + private final IDepartmentService departmentService; + + @Override + public IPage selectWorkFilingPage(IPage page, WorkFilingDTO workFiling) { + String deptId = Func.isNotEmpty(workFiling.getDeptId())?workFiling.getDeptId():AuthUtil.getDeptId(); + List aimDepts = inspectionDataService.setDeptIds(deptId, workFiling.getIncludeChildren()); + String userId =String.valueOf(AuthUtil.getUserId()); + workFiling.setQueryUserId(userId); + List vos = baseMapper.selectWorkFilingList(page, workFiling,aimDepts); + if(vos.size()>0){ + vos.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + return page.setRecords(vos); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R handin(WorkFilingDTO workFilingDTO){ + workFilingDTO.setState("1"); + String deptName = workFilingDTO.getDeptName(); + if(Func.isBlank(deptName)){ + deptName=departmentService.getById(workFilingDTO.getDeptId()).getDeptName(); + } + // 知会报备对象 + //获取消息通知人员工号 + List userCodes = getNoticeUserCode(workFilingDTO); + String msg = "您收到一条["+deptName+"]提报的[安全管理信息化系统工作报备],事项名称为[" + workFilingDTO.getName() + "]"; + xYunClient.sendMessageToXYun(Func.join(userCodes,","),msg); + return saveData(workFilingDTO); + } + /** + * 获取消息通知人员工号 + */ + private List getNoticeUserCode(WorkFilingDTO workFilingDTO) { + List userCodes = new ArrayList<>(); + //获取消息通知人员工号 + List list = Arrays.asList(workFilingDTO.getReceiveUserId().split(",")); + if (Func.isNotEmpty(list)){ + list.forEach(userId ->{ + UserVO user = baseMapper.getUserById(userId); + if (Func.isNotEmpty(user)){ + userCodes.add(user.getCode()); + } + }); + } + return userCodes; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R saveData(WorkFilingDTO workFilingDTO) { + WorkFiling workFiling = Func.copy(workFilingDTO, WorkFiling.class); + this.saveOrUpdate(workFiling); + //保存相关附件 + fileService.saveAttachments(workFilingDTO.getFileList(),workFiling.getId()); + return R.data(workFiling); + } + + @Override + public WorkFilingVO getData(String id) { + WorkFilingVO vo = new WorkFilingVO(); + WorkFiling workFiling = this.getById(id); + if (Func.isNotEmpty(workFiling)) { + vo = Func.copy(workFiling, WorkFilingVO.class); + vo.setFileList(fileService.getAttachments(workFiling.getId(),workFiling.getGroupName())); + vo.setReceiveUserName(fileService.getUserNameByIds(Func.toStrList(workFiling.getReceiveUserId()))); + } + return vo; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkOvertimeReportingLinesServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkOvertimeReportingLinesServiceImpl.java new file mode 100644 index 0000000..83fcdd5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkOvertimeReportingLinesServiceImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service.impl; + +import org.security.trans.applyAndReport.entity.WorkOvertimeReportingLines; +import org.security.trans.applyAndReport.vo.WorkOvertimeReportingLinesVO; +import org.security.trans.applyAndReport.mapper.WorkOvertimeReportingLinesMapper; +import org.security.trans.applyAndReport.service.IWorkOvertimeReportingLinesService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 加班记录报备人员信息表 服务实现类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Service +public class WorkOvertimeReportingLinesServiceImpl extends ServiceImpl implements IWorkOvertimeReportingLinesService { + + @Override + public IPage selectWorkOvertimeReportingLinesPage(IPage page, WorkOvertimeReportingLinesVO workOvertimeReportingLines) { + return page.setRecords(baseMapper.selectWorkOvertimeReportingLinesPage(page, workOvertimeReportingLines)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkOvertimeReportingServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkOvertimeReportingServiceImpl.java new file mode 100644 index 0000000..3b891cf --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/service/impl/WorkOvertimeReportingServiceImpl.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.AllArgsConstructor; +import org.security.trans.applyAndReport.dto.WorkOvertimeReportingDTO; +import org.security.trans.applyAndReport.entity.WorkOvertimeReporting; +import org.security.trans.applyAndReport.entity.WorkOvertimeReportingLines; +import org.security.trans.applyAndReport.service.IWorkOvertimeReportingLinesService; +import org.security.trans.applyAndReport.vo.WorkOvertimeReportingVO; +import org.security.trans.applyAndReport.mapper.WorkOvertimeReportingMapper; +import org.security.trans.applyAndReport.service.IWorkOvertimeReportingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.flow.dto.FlowStartDTO; +import org.security.trans.flow.service.IFlowHistoryService; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import org.springblade.core.mp.support.Query; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 加班记录报备表 服务实现类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Service +@AllArgsConstructor +public class WorkOvertimeReportingServiceImpl extends ServiceImpl implements IWorkOvertimeReportingService { + private final IWorkOvertimeReportingLinesService workOvertimeReportingLinesService; + private final IFlowHistoryService flowHistoryService; + + @Override + public IPage selectWorkOvertimeReportingPage(WorkOvertimeReportingDTO workOvertimeReportingDTO, Query query) { + IPage page = Condition.getPage(query); + QueryWrapper queryWrapper = Condition.getQueryWrapper(BeanUtil.copyProperties(workOvertimeReportingDTO, WorkOvertimeReporting.class)); + IPage iPage = this.page(page, queryWrapper); + IPage res = new Page<>(); + res.setTotal(iPage.getTotal()); + res.setSize(iPage.getSize()); + res.setCurrent(iPage.getCurrent()); + res.setRecords(BeanUtil.copyProperties(iPage.getRecords(), WorkOvertimeReportingVO.class)); + return res; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveOrUpdateWorkOvertime(WorkOvertimeReportingDTO workOvertimeReportingDTO){ + WorkOvertimeReporting workOvertimeReporting = Func.copy(workOvertimeReportingDTO, WorkOvertimeReporting.class); + workOvertimeReporting.setState("0"); + this.saveOrUpdate(workOvertimeReporting); + //明细表信息 + List workOvertimeLinesList = workOvertimeReportingDTO.getWorkOvertimeLinesList(); + if (Func.isNotEmpty(workOvertimeLinesList)) { + workOvertimeLinesList.forEach(item -> { + item.setFormId(workOvertimeReporting.getId()); + }); + //更新明细表数据 + workOvertimeReportingLinesService.saveOrUpdateBatch(workOvertimeLinesList); + } + return this.saveOrUpdate(workOvertimeReporting); + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean handin(WorkOvertimeReportingDTO workOvertimeReportingDTO){ + WorkOvertimeReporting workOvertimeReporting = Func.copy(workOvertimeReportingDTO, WorkOvertimeReporting.class); + workOvertimeReporting.setState("1"); + this.saveOrUpdate(workOvertimeReporting); + //明细表信息 + List workOvertimeLinesList = workOvertimeReportingDTO.getWorkOvertimeLinesList(); + if (Func.isNotEmpty(workOvertimeLinesList)) { + workOvertimeLinesList.forEach(item -> { + item.setFormId(workOvertimeReporting.getId()); + }); + //更新明细表数据 + workOvertimeReportingLinesService.saveOrUpdateBatch(workOvertimeLinesList); + } + // 提交时挂载流程 + FlowStartDTO flowStartDTO = new FlowStartDTO(); + flowStartDTO.setBusinessLinkId(workOvertimeReporting.getId()); + flowStartDTO.setFlowBusinessCode("work_overtime"); + flowHistoryService.startFlow(flowStartDTO); + return this.saveOrUpdate(workOvertimeReporting); + } + + @Override + public WorkOvertimeReportingVO getDetailById(String id){ + WorkOvertimeReporting workOvertimeReporting=super.getById(id); + WorkOvertimeReportingVO workOvertimeReportingVO = Func.copy(workOvertimeReporting,WorkOvertimeReportingVO.class); + //获取明细信息 + List lineList = workOvertimeReportingLinesService.list(new QueryWrapper().eq("FORM_ID", id)); + if(Func.isNotEmpty(lineList)){ + workOvertimeReportingVO.setWorkOvertimeLinesList(lineList); + } + return workOvertimeReportingVO; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/DutyRecordsLinesVO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/DutyRecordsLinesVO.java new file mode 100644 index 0000000..f23761e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/DutyRecordsLinesVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.vo; + +import org.security.trans.applyAndReport.entity.DutyRecordsLines; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 视图实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "DutyRecordsLinesVO对象", description = "DutyRecordsLinesVO对象") +public class DutyRecordsLinesVO extends DutyRecordsLines { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/DutyRecordsVO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/DutyRecordsVO.java new file mode 100644 index 0000000..73e4f41 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/DutyRecordsVO.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.trans.applyAndReport.entity.DutyRecords; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.trans.applyAndReport.entity.DutyRecordsLines; +import org.springblade.core.secure.utils.AuthUtil; + +import java.util.List; + +/** + * 值班记录表视图实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "DutyRecordsVO对象", description = "值班记录表") +public class DutyRecordsVO extends DutyRecords { + private static final long serialVersionUID = 1L; +// 流程节点 + private String currentNode; + List dutyRecordsLinesList; + + @ApiModelProperty(value = "是否可编辑") + private boolean editable; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + + public boolean isEditable() { + if((Constant.HANDIN_STATE_DRAFT.equals(this.getState()) || Constant.HANDIN_STATE_REFUSE.equals(this.getState()) || ProcessConstant.CANCEL_STATE.equals(this.getState())) && this.getCreatedBy().equals(String.valueOf(AuthUtil.getUser().getUserId()))){ + return true; + } + return false; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/ExportRecordsVO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/ExportRecordsVO.java new file mode 100644 index 0000000..fb06859 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/ExportRecordsVO.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 导出值班记录实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@ApiModel(value = "ExportRecordsVO对象", description = "导出值班记录实体类") +@HeadRowHeight(20) +@ColumnWidth(25) +public class ExportRecordsVO{ + private static final long serialVersionUID = 1L; + /** + * 类型;1-工作日,2-非工作日 + */ + @ApiModelProperty(value = "类型;1-工作日,2-非工作日") + @ExcelProperty("类型") + private String type; + + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @ExcelProperty("机构名称") + private String organizationName; + + /** + * 值班开始时间 + */ + @ApiModelProperty(value = "值班开始时间") + @ExcelProperty("值班开始时间") + private String startTime; + /** + * 值班结束时间 + */ + @ApiModelProperty(value = "值班结束时间") + @ExcelProperty("值班结束时间") + private String endTime; + + /** + * 值班事项说明 + */ + @ApiModelProperty(value = "值班事项说明") + @ExcelProperty("值班事项说明") + private String description; + + /** + * 值班负责人 + */ + @ApiModelProperty(value = "值班负责人") + @ExcelProperty("值班负责人") + private String personInCharge; + + /** + * 带班领导 + */ + @ApiModelProperty(value = "带班领导") + @ExcelProperty("带班领导") + private String shiftLeader; + /** + * 带班领导电话 + */ + @ApiModelProperty(value = "带班领导电话") + @ExcelProperty("带班领导电话") + private String leaderTelephone; + /** + * 安保值班人员 + */ + @ApiModelProperty(value = "安保值班人员") + @ExcelProperty("安保值班人员") + private String securityWatchman; + /** + * 安保值班人员电话 + */ + @ApiModelProperty(value = "安保值班人员电话") + @ExcelProperty("安保值班人员电话") + private String securityWatchmanTelephone; + + /** + * 值班人员及电话 + */ + @ApiModelProperty(value = "值班人员及电话") + @ExcelProperty("值班人员及电话") + private String personnelOnDuties; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/NoteRemindVO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/NoteRemindVO.java new file mode 100644 index 0000000..8282c2e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/NoteRemindVO.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.trans.applyAndReport.entity.NoteRemind; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.Func; + +import static org.security.common.Constant.TASK_HANDIN_STATE_DRAFT; + +/** + * 便签提醒记录表视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "NoteRemindVO对象", description = "便签提醒记录表") +public class NoteRemindVO extends NoteRemind { + private static final long serialVersionUID = 1L; + // 是否可编辑 + private boolean editable; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + + public boolean isEditable() { + if ((Constant.REMINDER_STATE_DRAFT.equals(this.getState()) || ProcessConstant.CANCEL_STATE.equals(this.getState())) && this.getCreatedBy().contains(String.valueOf(AuthUtil.getUserId()))) { + return true; + } + return false; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkFilingVO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkFilingVO.java new file mode 100644 index 0000000..8888339 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkFilingVO.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.applyAndReport.entity.WorkFiling; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 工作报备表视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "WorkFilingVO对象", description = "工作报备表") +public class WorkFilingVO extends WorkFiling { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + @ApiModelProperty(value = "接收人名称") + private String receiveUserName; + + private List fileList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkOvertimeReportingLinesVO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkOvertimeReportingLinesVO.java new file mode 100644 index 0000000..8d9f40b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkOvertimeReportingLinesVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.vo; + +import org.security.trans.applyAndReport.entity.WorkOvertimeReportingLines; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 加班记录报备人员信息表视图实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "WorkOvertimeReportingLinesVO对象", description = "加班记录报备人员信息表") +public class WorkOvertimeReportingLinesVO extends WorkOvertimeReportingLines { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkOvertimeReportingVO.java b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkOvertimeReportingVO.java new file mode 100644 index 0000000..7f455a9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/applyAndReport/vo/WorkOvertimeReportingVO.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.applyAndReport.vo; + +import org.security.trans.applyAndReport.entity.WorkOvertimeReporting; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.trans.applyAndReport.entity.WorkOvertimeReportingLines; + +import java.util.List; + +/** + * 加班记录报备表视图实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "WorkOvertimeReportingVO对象", description = "加班记录报备表") +public class WorkOvertimeReportingVO extends WorkOvertimeReporting { + private static final long serialVersionUID = 1L; + List workOvertimeLinesList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/controller/AssessmentController.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/controller/AssessmentController.java new file mode 100644 index 0000000..f296c2a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/controller/AssessmentController.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.security.trans.assessment.service.IAssessmentDetailService; +import org.security.trans.assessment.service.IAssessmentService; +import org.security.trans.assessment.vo.AssessmentVO; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * 考核评价信息记录表 控制器 + * + * @author BladeX + * @since 2022-07-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/assessment") +@Api(value = "考核评价信息记录表", tags = "考核评价信息记录表接口") +public class AssessmentController extends BladeController { + + private final IAssessmentService assessmentService; + private final IAssessmentDetailService assessmentDetailService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入assessment") + public R detail(AssessmentVO assessmentVO) { + AssessmentVO detail = assessmentService.getDetail(assessmentVO); + return R.data(detail); + } + + /** + * 分页 考核评价信息记录表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入assessment") + public R> list(AssessmentVO assessmentVO, Query query) { + return R.data(assessmentService.getPage(Condition.getPage(query), assessmentVO)); + } + + /** + * 保存 考核评价信息记录表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "保存", notes = "传入assessment") + public R save(@Valid @RequestBody AssessmentVO assessmentVO) { + return assessmentService.saveWithDetail(assessmentVO); + } + + + /** + * 删除 考核评价信息记录表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(assessmentService.removeByIds(Func.toLongList(ids)) && assessmentDetailService.removeByParentId(ids)); + } + + /** + * 考核评价信息记录提交领导确认 + */ + @PostMapping("/handIn") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "考核评价信息记录提交领导确认", notes = "传入assessment") + public R handIn(@Valid @RequestBody AssessmentVO assessmentVO) { + return assessmentService.handIn(assessmentVO); + } + + /** + * 删除明细 考核评价信息明细记录表 + */ + @PostMapping("/removeDetails") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "删除", notes = "传入ids") + public R removeDetails(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(assessmentDetailService.removeByIds(Func.toLongList(ids))); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/dto/AssessmentDTO.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/dto/AssessmentDTO.java new file mode 100644 index 0000000..538c6eb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/dto/AssessmentDTO.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.assessment.entity.Assessment; +import org.security.trans.assessment.entity.AssessmentDetail; +import org.security.ht.vo.common.UploadVO; + +import java.util.List; + +/** + * 考核评价信息记录表数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class AssessmentDTO extends Assessment { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "明细list") + private List details; + + @ApiModelProperty(value = "文件list") + private List fileList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/dto/AssessmentDetailDTO.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/dto/AssessmentDetailDTO.java new file mode 100644 index 0000000..b650f55 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/dto/AssessmentDetailDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.dto; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.assessment.entity.AssessmentDetail; + +/** + * 考核评价明细表数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class AssessmentDetailDTO extends AssessmentDetail { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/entity/Assessment.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/entity/Assessment.java new file mode 100644 index 0000000..95885e9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/entity/Assessment.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.entity.common.BaseEntity; +import org.security.ht.entity.common.FlowEntity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 考核评价信息记录表实体类 + * + * @author BladeX + * @since 2022-07-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("T_ASSESSMENT") +@ApiModel(value = "Assessment对象", description = "考核评价信息记录表") +public class Assessment extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + @TableId("ID") + private String id; + /** + * 考核对象;1-内部机构,2-相关方 3-项目 + */ + @ApiModelProperty(value = "考核对象;1-内部机构,2-相关方,3-项目") + @TableField("TYPE") + private String type; + /** + * 考核类型;1-机构自评,2-行内考核,3-外部考核,4-外包公司考核,5-项目考核 + */ + @ApiModelProperty(value = "考核类型;1-机构自评,2-行内考核,3-外部考核,4-相关方考核,5-项目考核") + @TableField("ASSESSMENT_TYPE") + private String assessmentType; + /** + * 考评类型;1-综合考评,2-专项考评 + */ + @ApiModelProperty(value = "考评类型;1-综合考评,2-专项考评") + @TableField("EVALUATION_TYPE") + private String evaluationType; + /** + * 考核名称 + */ + @ApiModelProperty(value = "考核名称") + @TableField("EVALUATION_NAME") + private String evaluationName; + /** + * 考评开始日期 + */ + @ApiModelProperty(value = "考评开始日期") + @TableField("EVALUATION_START_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date evaluationStartDate; + /** + * 考评结束日期 + */ + @ApiModelProperty(value = "考评结束日期") + @TableField("EVALUATION_END_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date evaluationEndDate; + /** + * 考评方id + */ + @ApiModelProperty(value = "考评方id") + @TableField("EVALUATOR") + private String evaluator; + /** + * 考评方名称 + */ + @ApiModelProperty(value = "考评方名称") + @TableField("EVALUATOR_NAME") + private String evaluatorName; + /** + * 被考评方id + */ + @ApiModelProperty(value = "被考评方id") + @TableField("EVALUATED") + private String evaluated; + /** + * 被考评方名称 + */ + @ApiModelProperty(value = "被考评方名称") + @TableField("EVALUATED_NAME") + private String evaluatedName; + /** + * 考核总分 + */ + @ApiModelProperty(value = "考核总分") + @TableField("TOTAL_SCORE") + private BigDecimal totalScore; + /** + * 最终得分 + */ + @ApiModelProperty(value = "最终得分") + @TableField("FINAL_SCORE") + private BigDecimal finalScore; + /** + * 加分项总分 + */ + @ApiModelProperty(value = "加分项总分") + @TableField("PLUSES_SCORE") + private BigDecimal plusesScore; + /** + * 扣分项总分 + */ + @ApiModelProperty(value = "扣分项总分") + @TableField("DEDUCTION_SCORE") + private BigDecimal deductionScore; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 部门名称 + */ + @ApiModelProperty(value = "部门名称") + @TableField("DEPT_NAME") + private String deptName; + /** + * 逻辑删除标识符;;0-删除,1-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;;0-删除,1-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + @ApiModelProperty(value = "备注") + @TableField("REMAKE") + private String remake; + + @ApiModelProperty(value = "考核年份") + @TableField("ASSESSMENT_YEAR") + private String assessmentYear; + + @ApiModelProperty(value = "考核月份") + @TableField("ASSESSMENT_MONTH") + private String assessmentMonth; + + @ApiModelProperty(value = "状态(0-待提交,1-提交待确认 2-已确认)") + @TableField("STATE") + private String state; + + @ApiModelProperty(value = "需求符合情况") + @TableField("EVA1") + private BigDecimal eva1; + + @ApiModelProperty(value = "项目管理水平") + @TableField("EVA2") + private BigDecimal eva2; + + @ApiModelProperty(value = "人力及团队水平") + @TableField("EVA3") + private BigDecimal eva3; + + @ApiModelProperty(value = "项目实施质量") + @TableField("EVA4") + private BigDecimal eva4; + + @ApiModelProperty(value = "项目交付情况") + @TableField("EVA5") + private BigDecimal eva5; + + @ApiModelProperty(value = "存在问题及建议") + @TableField("PRB_AND_ADV") + private String prbAndAdv; + + @ApiModelProperty(value = "下步工作要求") + @TableField("NEXT_WORK_REQUIREMENT") + private String nextWorkRequirement; + /** + * 被考评项目id + */ + @ApiModelProperty(value = "被考评项目id") + @TableField("PROJECT_ID") + private String projectId; + /** + * 被考评项目id + */ + @ApiModelProperty(value = "被考评项目id") + @TableField("PROJECT_NAME") + private String projectName; + /** + * 附件groupName + */ + @ApiModelProperty(value = "附件groupName") + @TableField("GROUP_NAME") + private String groupName; + /** + * 提报用户 + */ + @ApiModelProperty(value = "提报用户") + @TableField("USER_ID") + private String userId; + /** + * 提报角色 + */ + @ApiModelProperty(value = "提报角色") + @TableField("ROLE_ID") + private String roleId; + /** + * 被考评机构id串;用于前端级联框显示 + */ + @ApiModelProperty(value = "被考评机构id串;用于前端级联框显示") + @TableField("dept_cascade") + private String deptCascade; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/entity/AssessmentDetail.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/entity/AssessmentDetail.java new file mode 100644 index 0000000..736ee55 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/entity/AssessmentDetail.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.entity.common.BaseEntity; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 考核评价明细表实体类 + * + * @author BladeX + * @since 2022-07-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("T_ASSESSMENT_DETAIL") +@ApiModel(value = "AssessmentDetail对象", description = "考核评价加分/扣分明细表") +public class AssessmentDetail extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + @TableId("ID") + private String id; + /** + * 考核评价记录关联id + */ + @ApiModelProperty(value = "考核评价记录关联id") + @TableField("PARENT_ID") + private String parentId; + /** + * 类别 + */ + @ApiModelProperty(value = "类别") + @TableField("ASSESSMENT_TYPE") + private String assessmentType; + /** + * 加分/扣分项名称 + */ + @ApiModelProperty(value = "名称") + @TableField("ASSESSMENT_NAME") + private String assessmentName; + /** + * 依据 + */ + @ApiModelProperty(value = "依据") + @TableField("ASSESSMENT_RULE") + private String assessmentRule; + /** + * 分值 + */ + @ApiModelProperty(value = "分值") + @TableField("SCORE") + private BigDecimal score; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARKS") + private String remarks; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 类型 1-加分 2-扣分 + */ + @ApiModelProperty(value = "类型 1-加分 2-扣分") + @TableField("SCORE_TYPE") + private String scoreType; + /** + * 检查内容 针对扣分 + */ + @ApiModelProperty(value = "检查内容") + @TableField("INSPECTION_CONTENT") + private String inspectionContent; + /** + * 异常情况说明 针对扣分 + */ + @ApiModelProperty(value = "异常情况说明") + @TableField("PROBLEM") + private String problem; + /** + * 整改状态 针对扣分 + */ + @ApiModelProperty(value = "整改状态") + @TableField("RECTIFY_STATE") + private String rectifyState; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentDetailMapper.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentDetailMapper.java new file mode 100644 index 0000000..7342758 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentDetailMapper.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.security.trans.assessment.entity.AssessmentDetail; + +/** + * 考核评价明细表 Mapper 接口 + * + * @author BladeX + * @since 2022-07-05 + */ +public interface AssessmentDetailMapper extends BaseMapper { + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentDetailMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentDetailMapper.xml new file mode 100644 index 0000000..dbc30ef --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentDetailMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentMapper.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentMapper.java new file mode 100644 index 0000000..29e589e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentMapper.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.security.trans.assessment.entity.Assessment; +import org.security.trans.assessment.vo.AssessmentVO; +import org.security.trans.dataStatistics.dto.AssessmentDataDTO; +import org.security.trans.dataStatistics.vo.AssessmentDataVO; +import org.security.trans.dataStatistics.vo.RiskDataVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; +import java.util.List; + +/** + * 考核评价信息记录表 Mapper 接口 + * + * @author BladeX + * @since 2022-07-05 + */ +public interface AssessmentMapper extends BaseMapper { + + + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List getData(@Param("assessmentVO") AssessmentVO assessmentVO); + + List getAimStatisticsData(@Param("assessmentDataDTO") AssessmentDataDTO assessmentDataDTO, @Param("aimDepts") List aimDepts, @Param("aimType") List aimType); + + List getProjectStatisticsData(@Param("assessmentDataDTO") AssessmentDataDTO assessmentDataDTO,@Param("aimType") List aimType); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentMapper.xml new file mode 100644 index 0000000..7219974 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/mapper/AssessmentMapper.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/service/IAssessmentDetailService.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/service/IAssessmentDetailService.java new file mode 100644 index 0000000..1a9ac18 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/service/IAssessmentDetailService.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.trans.assessment.entity.AssessmentDetail; +import org.security.trans.assessment.vo.AssessmentDetailVO; + +import java.util.List; + +/** + * 考核评价明细表 服务类 + * + * @author BladeX + * @since 2022-07-05 + */ +public interface IAssessmentDetailService extends IService { + + List getByParentId(String parentId); + + boolean removeByParentId(String parentIds); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/service/IAssessmentService.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/service/IAssessmentService.java new file mode 100644 index 0000000..f6ad897 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/service/IAssessmentService.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.service; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.trans.assessment.entity.Assessment; +import org.security.trans.assessment.vo.AssessmentVO; +import org.security.trans.common.service.FlowableService; +import org.security.trans.dataStatistics.dto.AssessmentDataDTO; +import org.security.trans.dataStatistics.vo.AssessmentDataVO; +import org.security.trans.dataStatistics.vo.RiskDataVO; +import org.security.trans.projectBudgetManagement.dto.ProjectDTO; +import org.security.trans.projectBudgetManagement.vo.ProjectVO; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; + +import java.util.List; + +/** + * 考核评价信息记录表 服务类 + * + * @author BladeX + * @since 2022-07-05 + */ +public interface IAssessmentService extends FlowableService { + + /** + * 查询明细 + */ + AssessmentVO getDetail(AssessmentVO assessmentVO); + + /** + * 保存主表和明细 + */ + R saveWithDetail(AssessmentVO assessmentVO); + + IPage getPage(IPage page, AssessmentVO assessmentVO); + + /** + * 考核评价记录提交领导审批 + * @param assessmentVO + * @return + */ + R handIn(AssessmentVO assessmentVO); + + /** + * 考核评价数据统计(机构考核评价、相关方考核评价) + * @param assessmentDataDTO + * @param aimDepts + * @param aimType + * @return + */ + List getAimStatisticsData(AssessmentDataDTO assessmentDataDTO, List aimDepts, List aimType); + + /** + * 考核评价数据统计(项目考核评价) + * @param assessmentDataDTO + * @param aimType + * @return + */ + List getProjectStatisticsData(AssessmentDataDTO assessmentDataDTO, List aimType); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/service/impl/AssessmentDetailServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/service/impl/AssessmentDetailServiceImpl.java new file mode 100644 index 0000000..df1471e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/service/impl/AssessmentDetailServiceImpl.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang.StringUtils; +import org.security.trans.assessment.entity.AssessmentDetail; +import org.security.trans.assessment.mapper.AssessmentDetailMapper; +import org.security.trans.assessment.service.IAssessmentDetailService; +import org.security.trans.assessment.vo.AssessmentDetailVO; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.List; + +/** + * 考核评价明细表 服务实现类 + * + * @author BladeX + * @since 2022-07-05 + */ +@Service +public class AssessmentDetailServiceImpl extends ServiceImpl implements IAssessmentDetailService { + + @Override + public List getByParentId(String parentId) { + if (StringUtils.isBlank(parentId)) { + return Collections.emptyList(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("PARENT_ID", parentId); + List assessmentDetails = baseMapper.selectList(queryWrapper); + return BeanUtil.copyProperties(assessmentDetails, AssessmentDetailVO.class); + } + + @Override + public boolean removeByParentId(String parentIds) { + List ids = Func.toLongList(parentIds); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("PARENT_ID", ids); + return this.remove(queryWrapper); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/service/impl/AssessmentServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/service/impl/AssessmentServiceImpl.java new file mode 100644 index 0000000..0d25736 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/service/impl/AssessmentServiceImpl.java @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.ht.entity.basic.Department; +import org.security.system.feign.ISysClient; +import org.security.trans.assessment.entity.Assessment; +import org.security.trans.assessment.entity.AssessmentDetail; +import org.security.trans.assessment.mapper.AssessmentMapper; +import org.security.trans.assessment.service.IAssessmentDetailService; +import org.security.trans.assessment.service.IAssessmentService; +import org.security.trans.assessment.vo.AssessmentDetailVO; +import org.security.trans.assessment.vo.AssessmentVO; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dataStatistics.dto.AssessmentDataDTO; +import org.security.trans.dataStatistics.vo.AssessmentDataVO; +import org.security.trans.dataStatistics.vo.RiskDataVO; +import org.security.trans.outsourcing.service.IOutCompanyService; +import org.security.trans.projectBudgetManagement.service.IProjectService; +import org.security.trans.projectBudgetManagement.vo.ProjectVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 考核评价信息记录表 服务实现类 + * + * @author BladeX + * @since 2022-07-05 + */ +@AllArgsConstructor +@Service +@Slf4j +public class AssessmentServiceImpl extends ServiceImpl implements IAssessmentService { + + private final IAssessmentDetailService assessmentDetailService; + private final IFileService fileService; + private final IDepartmentService departmentService; + private final IOutCompanyService outCompanyService; + private final IProjectService projectService; + private final IFlowClient flowClient; + private final ISysClient sysClient; + + @Override + public IPage getPage(IPage page, AssessmentVO assessmentVO) { + //获取登录机构作为考评方的数据 + List list = baseMapper.getData(assessmentVO); + //获取当前登录机构作为被考评方,且处于考评结束节点的考评数据 + List assessments = this.list(new QueryWrapper().lambda().eq(Assessment::getDelFlag, Constant.DELETE_FLAG_0) + .eq(Assessment::getState, Constant.HANDIN_STATE_FINISH) + .eq(Func.isNotEmpty(assessmentVO.getType()),Assessment::getType,assessmentVO.getType()) + .eq(Assessment::getEvaluated, AuthUtil.getDeptId())); + List assessmentVOList = Func.copy(assessments, AssessmentVO.class); + list.addAll(assessmentVOList); + ArrayList vos = list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Assessment::getId))), ArrayList::new)); + vos.forEach(this::setReturnResult); + IPage res = new Page<>(); + res.setTotal(page.getTotal()); + res.setSize(page.getSize()); + res.setCurrent(page.getCurrent()); + List collect = vos.stream().sorted(Comparator.comparing(AssessmentVO::getCreatedTime).reversed()).collect(Collectors.toList()); + res.setRecords(collect); + return res; + } + /** + * 处理返回对象,根据id获取对应name值 + */ + private void setReturnResult(AssessmentVO item) { + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + //考评项目名称 项目考评需要查询项目name + if ("5".equals(item.getAssessmentType()) && Func.isEmpty(item.getProjectName())) { + item.setProjectName(projectService.getById(item.getProjectId()).getProjectName()); + }else if("4".equals(item.getAssessmentType()) && Func.isEmpty(item.getEvaluatedName())){ + //相关方考评,需查被考评公司名称 + item.setEvaluatedName(outCompanyService.getById(item.getEvaluated()).getOutCompanyName()); + } + } + + @Override + public R handIn(AssessmentVO assessmentVO) { + R res = saveWithDetail(assessmentVO); + if (!res.isSuccess()) { + throw new ServiceException("保存失败!"); + } + Assessment assessment = res.getData(); + +// boolean b; + //提交领导确认的考核评价主表记录入库 +// if (Func.isNotEmpty(assessment.getId())){ +// b = this.update(assessment, new UpdateWrapper().lambda().eq(Assessment::getId, assessment.getId()).eq(Assessment::getState, Constant.USUAL_STATE_FALSE)); +// }else { +// b = this.save(assessment); +// } + // 啥都不改调用save或update会返回false,所以注释掉 + // if (!b) { + // return R.fail(400,"该考核记录已提交领导确认,请勿重复提交"); + // } + + //发起流程提报 + Kv variables = Kv.create().set(ProcessConstant.BUSINESS_ID_KEY, assessment.getId()); + String businessTable = FlowUtil.getBusinessTable(Assessment.class); + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + variables.set("deptCategory", deptCategory.getData()); + variables.set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + String assessmentKey; + switch (assessment.getAssessmentType()) { + case "1": + assessmentKey = ProcessConstant.BANK_ASSESSMENT_KEY; + variables.set("selfAssessment", true); + break; + case "2": + assessmentKey = ProcessConstant.BANK_ASSESSMENT_KEY; + variables.set("selfAssessment", true); + break; + case "3": + assessmentKey = ProcessConstant.BANK_ASSESSMENT_KEY; + variables.set("selfAssessment", false); + break; + case "4": + assessmentKey = ProcessConstant.OUTSOURCING_ASSESSMENT_KEY; + // 是否是分行下发 + variables.set("branchStart", false); + break; + case "5": + assessmentKey = ProcessConstant.PROJECT_ASSESSMENT_KEY; + break; + default: + throw new ServiceException("不支持的考评类型"); + } + + R definitionRes = flowClient.getLatestProcessDefinitionByKey(assessmentKey); + if (definitionRes.isSuccess()) { + assessment.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("查询流程定义失败"); + } + R result = flowClient.startProcessInstanceById(assessment.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(assessment.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + assessment.setProcessInstanceId(result.getData().getProcessInstanceId()); + assessment.setState(Constant.HANDIN_STATE_AUDIT); + } else { + throw new ServiceException("开启流程失败"); + } + this.updateById(assessment); + return R.success("提交成功"); + } + + @Override + public List getAimStatisticsData(AssessmentDataDTO assessmentDataDTO, List aimDepts, List aimType) { + return baseMapper.getAimStatisticsData(assessmentDataDTO,aimDepts,aimType); + } + + @Override + public List getProjectStatisticsData(AssessmentDataDTO assessmentDataDTO, List aimType) { + return baseMapper.getProjectStatisticsData(assessmentDataDTO,aimType); + } + + @Override + public AssessmentVO getDetail(AssessmentVO assessmentVO) { + Assessment query = BeanUtil.copyProperties(assessmentVO, Assessment.class); + QueryWrapper queryWrapper = Condition.getQueryWrapper(query); + Assessment assessment = baseMapper.selectOne(queryWrapper); + List detailVOS = assessmentDetailService.getByParentId(assessment.getId()); + AssessmentVO res = BeanUtil.copyProperties(assessment, AssessmentVO.class); + this.setReturnResult(res); + res.setDetails(detailVOS); + res.setFileList(fileService.getAttachments(assessment.getId(),assessment.getGroupName())); + return res; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R saveWithDetail(AssessmentVO assessmentVO) { + Assessment assessment = BeanUtil.copyProperties(assessmentVO, Assessment.class); + if(Func.isNull(assessment.getDeptId()) || Func.isBlank(assessment.getDeptId())){ + assessment.setDeptId(AuthUtil.getDeptId()); + } + Department dep = departmentService.getById(assessment.getDeptId()); + assessment.setDeptName(Func.isNull(dep)?dep.getDeptName():""); + List voDetails = assessmentVO.getDetails(); +// 如果是机构考评,除加分项、扣分项之外的考评得分默认为考评总分; +// 如果是相关方考评和项目考评,除加分项、扣分项之外的考评得分为eva1--eva5的加总 +// BigDecimal score = assessment.getTotalScore(); +// if("4".equals(assessment.getAssessmentType()) || "5".equals(assessment.getAssessmentType())){ +// score=assessment.getEva1().add(assessment.getEva2()).add(assessment.getEva3()).add(assessment.getEva4()).add(assessment.getEva5()); +// } + BigDecimal plusesScore = BigDecimal.ZERO;//加分项合计 + BigDecimal deductionScore = BigDecimal.ZERO;//扣分项合计 +// 如果有加分、扣分明细,计算加分合计与扣分合计 + if(Func.isNotEmpty(voDetails)){ + for (AssessmentDetailVO voDetail : voDetails) { + if ("1".equals(voDetail.getScoreType())) { + plusesScore = plusesScore.add(voDetail.getScore()); + } + if ("2".equals(voDetail.getScoreType())) { + deductionScore = deductionScore.add(voDetail.getScore()); + } + } + } + assessment.setPlusesScore(plusesScore); + assessment.setState(Constant.USUAL_STATE_FALSE); + assessment.setDeductionScore(deductionScore); + // 计算最终得分 计算后最终结果不得超过考评总分 +// BigDecimal tempScore = score.add(plusesScore).subtract(deductionScore); + // 2023-7-21注释 前端提醒后允许计算得分与手填最终总分不一致时允许提交,则后端不再进行自动计算,以手填得分为准 +// assessment.setFinalScore(tempScore.compareTo(assessmentVO.getFinalScore())==1?assessmentVO.getFinalScore():tempScore); + //被考评方名称赋值 + if (Func.isNotEmpty(assessment.getEvaluated())) { +// 被考评对象是行内机构 + if ("1".equals(assessment.getType())) { + assessment.setEvaluatedName(departmentService.getById(assessment.getEvaluated()).getDeptName()); + } +// 被考评对象是相关方公司 + else if ("2".equals(assessment.getType())) { + assessment.setEvaluatedName(outCompanyService.getById(assessment.getEvaluated()).getOutCompanyName()); + } + } + //项目考核被考评项目名称赋值 + if (Func.isNotEmpty(assessment.getProjectId())){ + assessment.setProjectName(projectService.getById(assessment.getProjectId()).getProjectName()); + } + + this.saveOrUpdate(assessment); + if(Func.isNotEmpty(voDetails)){ + List detailList = voDetails.stream().map(voDetail -> { + AssessmentDetail assessmentDetail = BeanUtil.copyProperties(voDetail, AssessmentDetail.class); + assessmentDetail.setParentId(assessment.getId()); + return assessmentDetail; + }).collect(Collectors.toList()); + assessmentDetailService.saveOrUpdateBatch(detailList); + } + List fileList = assessmentVO.getFileList(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, assessment.getId()); + } + return R.data(assessment); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/vo/AssessmentDetailVO.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/vo/AssessmentDetailVO.java new file mode 100644 index 0000000..ff81b6e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/vo/AssessmentDetailVO.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.vo; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import org.security.trans.assessment.entity.AssessmentDetail; + +/** + * 考核评价明细表视图实体类 + * + * @author BladeX + * @since 2022-07-05 + */ +@Data +@ApiModel(value = "AssessmentDetailVO对象", description = "考核评价明细表") +public class AssessmentDetailVO extends AssessmentDetail { + private static final long serialVersionUID = 1L; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/assessment/vo/AssessmentVO.java b/security-service/ht-security/src/main/java/org/security/trans/assessment/vo/AssessmentVO.java new file mode 100644 index 0000000..77b2503 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/assessment/vo/AssessmentVO.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.assessment.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.trans.assessment.entity.Assessment; +import org.security.ht.vo.common.UploadVO; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.Func; + +import java.util.List; + +/** + * 考核评价信息记录表视图实体类 + * + * @author BladeX + * @since 2022-07-05 + */ +@Data +@ApiModel(value = "AssessmentVO对象", description = "考核评价信息记录表") +public class AssessmentVO extends Assessment { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "被考评项目名称") + private String projectName; + + @ApiModelProperty(value = "明细list") + private List details; + + @ApiModelProperty(value = "文件list") + private List fileList; + + @ApiModelProperty(value = "是否可编辑") + private boolean editable; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + + private boolean deletable; + + public boolean isEditable() { + if((Constant.HANDIN_STATE_DRAFT.equals(this.getState()) + || ProcessConstant.CANCEL_STATE.equals(this.getState()) + || Constant.HANDIN_STATE_REFUSE.equals(this.getState())) + && this.getCreatedBy().equals(String.valueOf(AuthUtil.getUser().getUserId()))){ + return true; + } + return false; + } + + public boolean isDeletable() { + if(Constant.HANDIN_STATE_DRAFT.equals(this.getState()) + && Func.isNotEmpty(this.getCreatedBy()) && this.getCreatedBy().equals(String.valueOf(AuthUtil.getUser().getUserId()))){ + return true; + } + return false; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/controller/DepartmentController.java b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/DepartmentController.java new file mode 100644 index 0000000..fe6ef59 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/DepartmentController.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.controller; + +import io.swagger.annotations.*; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.validation.Valid; + +import org.security.ht.entity.basic.Department; +import org.security.system.entity.Dept; +import org.security.system.vo.DeptVO; +import org.security.trans.basic.dto.DepartmentDTO; +import org.security.ht.vo.basic.DeptDataVO; +import org.security.ht.vo.basic.MapDeptDataVO; +import org.security.ht.vo.basic.RoleDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.vo.basic.DepartmentVO; +import org.security.trans.basic.service.IDepartmentService; +import org.springblade.core.boot.ctrl.BladeController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Map; + +/** + * 基础信息-组织机构 控制器 + * + * @author BladeX + * @since 2022-03-07 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/department") +@Api(value = "基础信息-组织机构", tags = "基础信息-组织机构接口") +public class DepartmentController extends BladeController { + + private final IDepartmentService departmentService; + + /** + * 详情 + * create:qx + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入department") + public R detail(@PathVariable Long id) { + return R.data(departmentService.getDepartmentById(id)); + } + + /** + * 自定义分页 基础信息-组织机构 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入department") + public R> page(DepartmentVO department, Query query) { + IPage pages = departmentService.selectDepartmentPage(Condition.getPage(query), department); + return R.data(pages); + } + + /** + * 修改 基础信息-组织机构(完善组织机构信息) + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入departmentDTO") + public R update(@Valid @RequestBody DepartmentDTO departmentDTO) { + return R.status(departmentService.updateDeptData(departmentDTO)); + } + /** + * 新增 基础信息-组织机构(用于新增自助行) + */ + @PostMapping("/addSelfBank") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "新增", notes = "传入departmentDTO") + public R addSelfBank(@Valid @RequestBody DepartmentDTO departmentDTO) { + return departmentService.addSelfBank(departmentDTO); + } + + /** + * 删除 基础信息-组织机构 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(departmentService.removeByIds(Func.toLongList(ids))); + } + + /** + * 懒加载列表 + * create:qx + */ + @GetMapping("/lazy-list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deptName", value = "部门名称", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "deptLevel", value = "部门层级", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 9) + @ApiOperation(value = "懒加载列表", notes = "传入dept") + public R> lazyList(@ApiIgnore @RequestParam Map dept, String parentId) { + List list = departmentService.lazyList(dept, parentId); + return R.data(list); + } + + /** + * 联级选择器树形结构 + *create:qx + * @return + */ + @GetMapping("/cascade") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "树形结构", notes = "树形结构") + public R> cascadeSelection() { + List list = departmentService.cascadeSelection(); + return R.data(list); + } + + + /** + * 联级选择器树形结构 + *create:qx + * @return + */ + @GetMapping("/child-dept-tree") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "树形结构", notes = "树形结构") + public R> getChildDeptTree(String topDeptId) { + List list = departmentService.getChildDeptTree(topDeptId); + return R.data(list); + } + + /** + * 部门树 + * create:qx + */ + @GetMapping("/tree") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "部门树", notes = "传入dept") + public R> tree(DepartmentDTO departmentDTO) { + List list = departmentService.tree(departmentDTO); + return R.data(list); + } + + /** + * 根据部门id获取相关角色id + */ + @GetMapping("/data") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "根据部门id获取相关角色id", notes = "传入deptId") + public R> detail(String deptId) { + return R.data(departmentService.getData(deptId)); + } + + + /** + * 获取机构地图数据 + */ + @GetMapping("/map") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "获取机构地图数据", notes = "获取机构地图数据") + public R> getDeptMapDetail() { + return R.data(departmentService.getDeptMapDetail()); + } + + /** + * 消息总线信息同步,更新机构信息 + */ + @PostMapping("/syn/save/department") + public R saveDepartmentData(@RequestBody List departmentList){ + return R.status(departmentService.saveDepartmentData(departmentList)); + } + + /** + * 懒加载列表 for下发任务 + */ + @GetMapping("/lazy-list-for-task") + @ApiImplicitParams({ + @ApiImplicitParam(name = "deptName", value = "部门名称", paramType = "query", dataType = "string"), + @ApiImplicitParam(name = "deptLevel", value = "部门层级", paramType = "query", dataType = "string") + }) + @ApiOperationSupport(order = 9) + @ApiOperation(value = "懒加载列表", notes = "传入dept") + public R> lazyListForTask(@ApiIgnore @RequestParam Map dept, String parentId) { + List list = departmentService.lazyListForTask(dept, parentId); + return R.data(list); + } + + /** + * 自助银行列表 + */ + @GetMapping("/self-bank-list") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "自助银行列表", notes = "") + public R> getSelfBankData() { + return R.data(departmentService.getSelfBankData()); + } + + + /** + * 获取总行营业部室----项目预算总行管理部门 + */ + @GetMapping("/budget-dept") + @ApiOperationSupport(order = 12) + @ApiOperation(value = "获取总行营业部室----项目预算总行管理部门", notes = "") + public R> getBudgetDept() { + return R.data(departmentService.getBudgetDept()); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/controller/DeviceController.java b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/DeviceController.java new file mode 100644 index 0000000..0cfd4e0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/DeviceController.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.system.dto.MenuDTO; +import org.security.system.vo.MenuVO; +import org.security.trans.basic.dto.DeviceDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.entity.basic.Device; +import org.security.ht.vo.basic.DeviceVO; +import org.security.trans.basic.service.IDeviceService; +import org.springblade.core.boot.ctrl.BladeController; +import org.springframework.web.multipart.MultipartFile; + +import java.text.ParseException; +import java.util.List; + +/** + * 基础信息-设备信息 控制器 + * + * @author BladeX + * @since 2022-03-16 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/device") +@Api(value = "基础信息-设备信息", tags = "基础信息-设备信息接口") +public class DeviceController extends BladeController { + + private final IDeviceService deviceService; + + /** + * 详情 + * create:qx + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入device") + public R detail(@PathVariable Long id) { + DeviceVO deviceVO = deviceService.getDeviceById(id); + return R.data(deviceVO); + } + + /** + * 分页 基础信息-设备信息---用于查询自助银行本级机构的设备信息 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入device") + public R> list(DeviceDTO device, Query query) { + IPage pages = deviceService.page(Condition.getPage(query), Condition.getQueryWrapper(device)); + return R.data(pages); + } + + /** + * 自定义分页 基础信息-设备信息 + * create:qx + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入device") + public R> page(DeviceDTO deviceDto, Query query) { + IPage pages = deviceService.selectDevicePage(Condition.getPage(query), deviceDto); + return R.data(pages); + } + + /** + * 保存 基础信息-设备信息 + * create:qx + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增修改", notes = "传入device") + public R save(@Valid @RequestBody DeviceDTO deviceDTO) { + return R.status(deviceService.saveDevice(deviceDTO)); + } + + + /** + * 处置设备-设备信息 + */ + @PostMapping("/disposal") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "处置设备", notes = "传入ids") + public R disposal(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return deviceService.disposalByIds(Func.toLongList(ids)); + } + + + /** + * 删除 基础信息-设备信息 + * + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids){ + return deviceService.removeDevice(Func.toLongList(ids)); + } + + + + /** + * 生成二维码 + * + */ + @PostMapping("/create/QR_code") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "生成二维码", notes = "传入ids") + public R createQrCode(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(deviceService.createQrCode(Func.toLongList(ids))); + } + + /** + * 通过excel导入设备信息 + */ + @PostMapping("/importExcel") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "导入设备信息", notes = "传入file") + public R saveInspectionlineData(MultipartFile file) { + return deviceService.importData(file); + } + + @PostMapping("/menuDetail") + @ApiOperationSupport(order = 11) + @ApiOperation(value = "获取菜单详情", notes = "传入menu") + public R getMenuDetail(@Valid @RequestBody MenuDTO menuDTO) { + return deviceService.getMenuDetail(menuDTO); + } + + @PostMapping("/roleMenuIds") + @ApiOperationSupport(order = 12) + @ApiOperation(value = "获取角色对应菜单Id", notes = "传入roleIds") + public R> getMenuIds(@ApiParam(value = "主键集合", required = true) @RequestParam String roleIds) { + return R.data(deviceService.roleMenuTreeKeys(roleIds)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/controller/EmployeeController.java b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/EmployeeController.java new file mode 100644 index 0000000..599213a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/EmployeeController.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.validation.Valid; + +import org.security.trans.basic.dto.EmployeeDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.entity.basic.Employee; +import org.security.ht.vo.basic.EmployeeVO; +import org.security.trans.basic.service.IEmployeeService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.util.List; +import java.util.Objects; + +/** + * 基础信息-员工 控制器 + * + * @author BladeX + * @since 2022-03-07 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/employee") +@Api(value = "基础信息-员工", tags = "基础信息-员工接口") +public class EmployeeController extends BladeController { + + private final IEmployeeService employeeService; + + /** + * 详情 + * create:qx + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + EmployeeVO employeeVO = employeeService.getEmployeeAndFamiliesAndJobRecords(id); + return R.data(employeeVO); + } + + /** + * 自定义分页 基础信息-员工 + * create:qx + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入employeeDTO") + public R> page(EmployeeDTO employeeDTO, Query query) { + IPage pages = employeeService.selectEmployeePage(Condition.getPage(query), employeeDTO); + return R.data(pages); + } + + /** + * 新增 基础信息-员工 + * create:qx + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入employeeDTO") + public R save(@Valid @RequestBody EmployeeDTO employeeDTO) { + if (employeeService.saveEmployeeAndFamiliesAndJobRecords(employeeDTO)) { + return R.status(true); + } else { + return R.fail("身份证号重复"); + } + } + + /** + * 修改 基础信息-员工 + * create:qx + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入employeeDTO") + public R update(@Valid @RequestBody EmployeeDTO employeeDTO) { + return R.status(employeeService.updateEmployeeAndFamiliesAndJobRecords(employeeDTO)); + } + + /** + * 新增或修改 基础信息-员工 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入employee") + public R submit(@Valid @RequestBody Employee employee) { + return R.status(employeeService.saveOrUpdate(employee)); + } + + + /** + * 删除 基础信息-员工 + * create:qx + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(employeeService.removeEmployeeAndFamiliesAndJobRecords(Func.toLongList(ids))); + } + + /** + * 获取安全员,负责人,分管领导等 + * create:qx + */ + @GetMapping("/leader") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "获取安全员,负责人,分管领导等", notes = "获取安全员,负责人,分管领导等") + public R getLeader() { + return R.data(employeeService.getLeaderByDeptId()); + } + + @ApiOperationSupport(order = 1) + @ApiOperation(value = "根据身份证查询员工") + @GetMapping("/detail/{idCardNo}") + public R getDetail(@PathVariable String idCardNo) { + Employee employee = employeeService.getOne(new QueryWrapper().eq("id_card", idCardNo)); + if (Objects.isNull(employee)) { + return R.fail("未查询到员工"); + } + return R.data(BeanUtil.copy(employee, EmployeeVO.class)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/controller/FamilyController.java b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/FamilyController.java new file mode 100644 index 0000000..c05b886 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/FamilyController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.entity.basic.Family; +import org.security.ht.vo.basic.FamilyVO; +import org.security.trans.basic.service.IFamilyService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 基础信息-员工家庭成员 控制器 + * + * @author BladeX + * @since 2022-03-08 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/family") +@Api(value = "基础信息-员工家庭成员", tags = "基础信息-员工家庭成员接口") +public class FamilyController extends BladeController { + + private final IFamilyService familyService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入family") + public R detail(Family family) { + Family detail = familyService.getOne(Condition.getQueryWrapper(family)); + return R.data(detail); + } + + /** + * 分页 基础信息-员工家庭成员 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入family") + public R> list(Family family, Query query) { + IPage pages = familyService.page(Condition.getPage(query), Condition.getQueryWrapper(family)); + return R.data(pages); + } + + /** + * 自定义分页 基础信息-员工家庭成员 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入family") + public R> page(FamilyVO family, Query query) { + IPage pages = familyService.selectFamilyPage(Condition.getPage(query), family); + return R.data(pages); + } + + /** + * 新增 基础信息-员工家庭成员 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入family") + public R save(@Valid @RequestBody Family family) { + return R.status(familyService.save(family)); + } + + /** + * 修改 基础信息-员工家庭成员 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入family") + public R update(@Valid @RequestBody Family family) { + return R.status(familyService.updateById(family)); + } + + /** + * 新增或修改 基础信息-员工家庭成员 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入family") + public R submit(@Valid @RequestBody Family family) { + return R.status(familyService.saveOrUpdate(family)); + } + + + /** + * 删除 基础信息-员工家庭成员 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(familyService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/controller/JobRecordController.java b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/JobRecordController.java new file mode 100644 index 0000000..3e3ebf6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/JobRecordController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.entity.basic.JobRecord; +import org.security.ht.vo.basic.JobRecordVO; +import org.security.trans.basic.service.IJobRecordService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 基础信息-员工工作履历 控制器 + * + * @author BladeX + * @since 2022-03-08 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/jobrecord") +@Api(value = "基础信息-员工工作履历", tags = "基础信息-员工工作履历接口") +public class JobRecordController extends BladeController { + + private final IJobRecordService jobRecordService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入jobRecord") + public R detail(JobRecord jobRecord) { + JobRecord detail = jobRecordService.getOne(Condition.getQueryWrapper(jobRecord)); + return R.data(detail); + } + + /** + * 分页 基础信息-员工工作履历 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入jobRecord") + public R> list(JobRecord jobRecord, Query query) { + IPage pages = jobRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(jobRecord)); + return R.data(pages); + } + + /** + * 自定义分页 基础信息-员工工作履历 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入jobRecord") + public R> page(JobRecordVO jobRecord, Query query) { + IPage pages = jobRecordService.selectJobRecordPage(Condition.getPage(query), jobRecord); + return R.data(pages); + } + + /** + * 新增 基础信息-员工工作履历 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入jobRecord") + public R save(@Valid @RequestBody JobRecord jobRecord) { + return R.status(jobRecordService.save(jobRecord)); + } + + /** + * 修改 基础信息-员工工作履历 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入jobRecord") + public R update(@Valid @RequestBody JobRecord jobRecord) { + return R.status(jobRecordService.updateById(jobRecord)); + } + + /** + * 新增或修改 基础信息-员工工作履历 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入jobRecord") + public R submit(@Valid @RequestBody JobRecord jobRecord) { + return R.status(jobRecordService.saveOrUpdate(jobRecord)); + } + + + /** + * 删除 基础信息-员工工作履历 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(jobRecordService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/controller/LawController.java b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/LawController.java new file mode 100644 index 0000000..784ef66 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/LawController.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.basic.dto.LawDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.entity.basic.Law; +import org.security.ht.vo.basic.LawVO; +import org.security.trans.basic.service.ILawService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.math.BigDecimal; + +/** + * 控制器 + * + * @author BladeX + * @since 2022-05-30 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/law") +@Api(value = "", tags = "法律法规") +public class LawController extends BladeController { + + private final ILawService lawService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable BigDecimal id) { + LawVO lawVO = lawService.getLawById(id); + return R.data(lawVO); + } + + /** + * 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入law") + public R> list(Law law, Query query) { + IPage pages = lawService.page(Condition.getPage(query), Condition.getQueryWrapper(law)); + return R.data(pages); + } + + /** + * 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入law") + public R> page(LawDTO law, Query query) { + IPage pages = lawService.selectLawPage(Condition.getPage(query), law); + return R.data(pages); + } + + /** + * 保存 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "保存", notes = "传入law") + public R save(@Valid @RequestBody LawDTO law) { + return lawService.saveLaw(law); + } + + /** + * 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入law") + public R update(@Valid @RequestBody Law law) { + return R.status(lawService.updateById(law)); + } + + /** + * 提交 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "提交", notes = "传入law") + public R submit(@Valid @RequestBody LawDTO law) { + return lawService.submit(law); + } + + + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(lawService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/controller/MailListController.java b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/MailListController.java new file mode 100644 index 0000000..ab0b374 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/MailListController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.entity.basic.MailList; +import org.security.ht.vo.basic.MailListVO; +import org.security.trans.basic.service.IMailListService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 基础信息-联系信息表 控制器 + * + * @author BladeX + * @since 2022-05-18 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/maillist") +@Api(value = "基础信息-联系信息表", tags = "基础信息-联系信息表接口") +public class MailListController extends BladeController { + + private final IMailListService mailListService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入mailList") + public R detail(MailList mailList) { + MailList detail = mailListService.getOne(Condition.getQueryWrapper(mailList)); + return R.data(detail); + } + + /** + * 分页 基础信息-联系信息表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入mailList") + public R> list(MailList mailList, Query query) { + IPage pages = mailListService.page(Condition.getPage(query), Condition.getQueryWrapper(mailList)); + return R.data(pages); + } + + /** + * 自定义分页 基础信息-联系信息表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入mailList") + public R> page(MailListVO mailList, Query query) { + IPage pages = mailListService.selectMailListPage(Condition.getPage(query), mailList); + return R.data(pages); + } + + /** + * 新增 基础信息-联系信息表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入mailList") + public R save(@Valid @RequestBody MailList mailList) { + return R.status(mailListService.save(mailList)); + } + + /** + * 修改 基础信息-联系信息表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入mailList") + public R update(@Valid @RequestBody MailList mailList) { + return R.status(mailListService.updateById(mailList)); + } + + /** + * 新增或修改 基础信息-联系信息表 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入mailList") + public R submit(@Valid @RequestBody MailList mailList) { + return R.status(mailListService.saveOrUpdate(mailList)); + } + + + /** + * 删除 基础信息-联系信息表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(mailListService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/controller/SelfHelpBankController.java b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/SelfHelpBankController.java new file mode 100644 index 0000000..b3d5937 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/controller/SelfHelpBankController.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.basic.dto.SelfHelpBankDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.entity.basic.SelfHelpBank; +import org.security.ht.vo.basic.SelfHelpBankVO; +import org.security.trans.basic.service.ISelfHelpBankService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 基础信息-自助银行 控制器 + * + * @author BladeX + * @since 2022-03-16 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/selfhelpbank") +@Api(value = "基础信息-自助银行", tags = "基础信息-自助银行接口") +public class SelfHelpBankController extends BladeController { + + private final ISelfHelpBankService selfHelpBankService; + + /** + * 详情 + * create:qx + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable Long id) { + SelfHelpBankVO selfHelpBankVO = selfHelpBankService.getSelfHelpBankById(id); + return R.data(selfHelpBankVO); + } + + + /** + * 自定义分页 基础信息-自助银行 + * create:qx + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入selfHelpBank") + public R> page(SelfHelpBankDTO selfHelpBankDTO, Query query) { + IPage pages = selfHelpBankService.selectSelfHelpBankPage(Condition.getPage(query), selfHelpBankDTO); + return R.data(pages); + } + + /** + * 新增 基础信息-自助银行 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入selfHelpBank") + public R save(@Valid @RequestBody SelfHelpBank selfHelpBank) { + return R.status(selfHelpBankService.save(selfHelpBank)); + } + + /** + * 修改 基础信息-自助银行 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入selfHelpBank") + public R update(@Valid @RequestBody SelfHelpBank selfHelpBank) { + return R.status(selfHelpBankService.updateById(selfHelpBank)); + } + + /** + * 新增或修改 基础信息-自助银行 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入selfHelpBank") + public R submit(@Valid @RequestBody SelfHelpBank selfHelpBank) { + return R.status(selfHelpBankService.saveOrUpdate(selfHelpBank)); + } + + + /** + * 删除 基础信息-自助银行 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(selfHelpBankService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/DepartmentDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/DepartmentDTO.java new file mode 100644 index 0000000..2d40e54 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/DepartmentDTO.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.dto; + +import org.security.ht.entity.basic.Department; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.vo.common.UploadVO; + +import java.util.List; + +/** + * 基础信息-组织机构数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-07 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DepartmentDTO extends Department { + private static final long serialVersionUID = 1L; + + /** + * 机构相关照片 + */ + private List deptDisList; + /** + * 机构证件照片 + */ + private List deptLicenseList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/DeviceDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/DeviceDTO.java new file mode 100644 index 0000000..2aff0a6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/DeviceDTO.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.dto; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.basic.Device; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.vo.common.UploadVO; + +import java.util.List; + +/** + * 基础信息-设备信息数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DeviceDTO extends Device { + private static final long serialVersionUID = 1L; + private String flag; + /** + * 设备图片 + */ + private List picList; + /** + * 统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级) + */ + @ApiModelProperty(value = "统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级)") + private String includeChildren; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/DeviceExcelDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/DeviceExcelDTO.java new file mode 100644 index 0000000..643538e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/DeviceExcelDTO.java @@ -0,0 +1,73 @@ +package org.security.trans.basic.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @author nantian.yangzhengyu + * @date 2022/12/6 15:05 + */ +@Data +public class DeviceExcelDTO { + /** + * 设备类型 + */ + @ApiModelProperty(value = "设备类型") + @ExcelProperty(value = "设备类型") + private String typeName; + /** + * 设备名称 + */ + @ApiModelProperty(value = "设备名称") + @ExcelProperty(value = "设备名称") + private String name; + /** + * 所属机构 + */ + @ApiModelProperty(value = "所属机构") + @ExcelProperty(value = "所属机构") + private String deptName; + /** + * 设备编号 + */ + @ApiModelProperty(value = "设备编号") + @ExcelProperty(value = "设备编号") + private String deviceNum; + /** + * 设备型号 + */ + @ApiModelProperty(value = "设备型号") + @ExcelProperty(value = "设备型号") + private String modelNum; + /** + * 设备厂商 + */ + @ApiModelProperty(value = "设备厂商") + @ExcelProperty(value = "设备厂商") + private String company; + + @ApiModelProperty(value = "放置位置") + @ExcelProperty(value = "放置位置") + private String address; + + @ApiModelProperty(value = "购买时间") + @ExcelProperty(value = "购买时间") + private String buyDate; + + @ApiModelProperty(value = "投产时间") + @ExcelProperty(value = "投产时间") + private String installDate; + + @ApiModelProperty(value = "维保到期时间") + @ExcelProperty(value = "维保到期时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date maintenanceDate; + + @ApiModelProperty(value = "使用状态") + @ExcelProperty(value = "使用状态") + private String usageStateName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/EmployeeDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/EmployeeDTO.java new file mode 100644 index 0000000..4280be6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/EmployeeDTO.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.dto; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.basic.Employee; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.entity.basic.Family; +import org.security.ht.entity.basic.JobRecord; +import org.security.ht.vo.common.UploadVO; + +import java.util.List; + +/** + * 基础信息-员工数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-07 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class EmployeeDTO extends Employee { + private static final long serialVersionUID = 1L; + private List families; + private List jobRecords; + + /** + * 企业工龄(1:5年以下, + * 2:[5-10)年, + * 3:[10-20}年, + * 4:[20-30)年, + * 5:30年及以上) + */ + private Integer seniorityInEnterprise; + + + /** + * 行内工龄(1:5年以下, + * 2:[5-10)年, + * 3:[10-20)年, + * 4:[20-30)年, + * 5:30年及以上) + */ + private Integer professionalLengthOfService; + + /** + * 年龄段(1:20岁以下, + * 2:[20-30)岁, + * 3:[30-40)岁, + * 4:[40-50)岁, + * 5:50岁及以上) + */ + private Integer ageGroup; + + /** + * 相关附件 + */ + private List relevantAttachments; + /** + * 证件照附件 + */ + private List picList; + /** + * 身份证正面照附件 + */ + private List idCardFrontList; + /** + * 身份证反面照附件 + */ + private List idCardBackList; + /** + * 统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级) + */ + @ApiModelProperty(value = "统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级)") + private String includeChildren; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/EmployeeDataCountDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/EmployeeDataCountDTO.java new file mode 100644 index 0000000..017d978 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/EmployeeDataCountDTO.java @@ -0,0 +1,15 @@ +package org.security.trans.basic.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author Create by wzf + * @date 2022/5/23 14:09 + * 员工数据统计模块查询条件 + */ +@Data +public class EmployeeDataCountDTO implements Serializable { + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/FamilyDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/FamilyDTO.java new file mode 100644 index 0000000..383220b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/FamilyDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.dto; + +import org.security.ht.entity.basic.Family; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 基础信息-员工家庭成员数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class FamilyDTO extends Family { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/JobRecordDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/JobRecordDTO.java new file mode 100644 index 0000000..6d15f08 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/JobRecordDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.dto; + +import org.security.ht.entity.basic.JobRecord; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 基础信息-员工工作履历数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class JobRecordDTO extends JobRecord { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/LawDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/LawDTO.java new file mode 100644 index 0000000..b83da7d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/LawDTO.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.dto; + +import org.security.ht.entity.basic.Law; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.vo.common.UploadVO; + +import java.util.List; + +/** + * 数据传输对象实体类 + * + * @author BladeX + * @since 2022-05-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class LawDTO extends Law { + private static final long serialVersionUID = 1L; + /** + * 法律法规附件 + */ + private List fileList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/MailListDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/MailListDTO.java new file mode 100644 index 0000000..aab95e2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/MailListDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.dto; + +import org.security.ht.entity.basic.MailList; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 基础信息-联系信息表数据传输对象实体类 + * + * @author BladeX + * @since 2022-05-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class MailListDTO extends MailList { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/dto/SelfHelpBankDTO.java b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/SelfHelpBankDTO.java new file mode 100644 index 0000000..2a9c682 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/dto/SelfHelpBankDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.dto; + +import org.security.ht.entity.basic.SelfHelpBank; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 基础信息-自助银行数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SelfHelpBankDTO extends SelfHelpBank { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/fegin/DepartmentClient.java b/security-service/ht-security/src/main/java/org/security/trans/basic/fegin/DepartmentClient.java new file mode 100644 index 0000000..b242641 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/fegin/DepartmentClient.java @@ -0,0 +1,44 @@ +package org.security.trans.basic.fegin; + +import lombok.AllArgsConstructor; +import org.security.ht.entity.basic.Department; +import org.security.ht.feign.basic.IDepartmentClient; +import org.security.trans.basic.service.IDepartmentService; +import org.springblade.core.tenant.annotation.NonDS; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author :wzf + * @apiNote :Department Feign实现类 + * @since :Created in 2022/9/19 11:36 + */ +@NonDS +@RestController +@AllArgsConstructor +public class DepartmentClient implements IDepartmentClient { + + private final IDepartmentService departmentService; + + @Override + @PostMapping(SYN_SAVE_DATA) + public R saveData(List departmentList) { + return R.status(departmentService.saveDepartmentData(departmentList)); + } + + @Override + @PostMapping(SYN_REMOVE_DATA) + public R removeData(String ids) { + return R.status(departmentService.removeDept(ids)); + } + + @Override + @GetMapping(DEPT_INFO_BY_ID) + public R deptInfoById(String id) { + return R.data(departmentService.getById(id)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/fegin/EmployeeClient.java b/security-service/ht-security/src/main/java/org/security/trans/basic/fegin/EmployeeClient.java new file mode 100644 index 0000000..ce99d5c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/fegin/EmployeeClient.java @@ -0,0 +1,41 @@ +package org.security.trans.basic.fegin; + +import lombok.AllArgsConstructor; +import org.security.ht.entity.basic.Employee; +import org.security.ht.feign.basic.IEmployeeClient; +import org.security.trans.basic.service.IEmployeeService; +import org.springblade.core.tenant.annotation.NonDS; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author :wzf + * @apiNote :员工服务Feign实现类 + * @since :Created in 2022/9/7 11:11 + */ +@NonDS +@RestController +@AllArgsConstructor +public class EmployeeClient implements IEmployeeClient { + private final IEmployeeService employeeService; + @Override + @GetMapping(EMPLOYEE_INFO) + public R getEmployeeAndFamiliesAndJobRecords(Long id) { + return R.data(employeeService.getById(id)); + } + + @Override + @PostMapping(SYS_EMPLOYEE_DATA) + public R synData(List employees) { + return R.status(employeeService.synEmployeeData(employees)); + } + @Override + @PostMapping(SYN_REMOVE_DATA) + public R removeData(String id) { + return R.status(employeeService.removeById(id)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DepartmentMapper.java b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DepartmentMapper.java new file mode 100644 index 0000000..9b257d1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DepartmentMapper.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.ht.entity.basic.Department; +import org.security.ht.vo.basic.DepartmentVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.vo.basic.EmployeeVO; +import org.security.ht.vo.basic.RoleDataVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * 基础信息-组织机构 Mapper 接口 + * + * @author BladeX + * @since 2022-03-07 + */ +@Repository +public interface DepartmentMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param department + * @return + */ + List selectDepartmentPage(IPage page, DepartmentVO department); + + List lazyList(String parentId, Map param); + + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "ID") + List lazyListForTask(String parentId, Map param); + + List cascade(@Param("deptId") String deptId); + + /** + * 根据部门id获取相关角色id + * @param deptId + * @return + */ + List getData(String deptId); + + /** + *自助银行列表 + */ + List getSelfBankData(@Param("deptId") String deptId); + + /** + * 根据部门id获取该机构员工 + * @param deptId + * @return + */ + List getEmployee(String deptId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DepartmentMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DepartmentMapper.xml new file mode 100644 index 0000000..8ac2497 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DepartmentMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DeviceMapper.java b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DeviceMapper.java new file mode 100644 index 0000000..0f3c6bc --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DeviceMapper.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.security.ht.entity.basic.Device; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.system.dto.MenuDTO; +import org.security.system.entity.Menu; +import org.security.system.entity.RoleMenu; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dataStatistics.entity.DeviceData; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 基础信息-设备信息 Mapper 接口 + * + * @author BladeX + * @since 2022-03-16 + */ +public interface DeviceMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param wrapper + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEP_ID") + @Select("SELECT * FROM T_DEVICE ${ew.customSqlSegment}") + IPage selectDevicePage(Page page, @Param(Constants.WRAPPER) Wrapper wrapper); + + List getRisSunChartData(@Param("aimDepts") List aimDepts); + + List deviceInspectionList(@Param("deviceId") String deviceId); + + List getPieDataByDeptId(@Param("parentDeptId") String parentDeptId); + +// @Select("SELECT * FROM BLADE_MENU ${ew.customSqlSegment}") + List getMenuDetail(@Param("menuDTO") MenuDTO menuDTO); + + List getRoleMenulist(@Param("roleIds") List roleIds); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DeviceMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DeviceMapper.xml new file mode 100644 index 0000000..5be5382 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/DeviceMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/EmployeeMapper.java b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/EmployeeMapper.java new file mode 100644 index 0000000..40a374f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/EmployeeMapper.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.security.ht.entity.basic.Employee; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.basic.dto.EmployeeDTO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * 基础信息-员工 Mapper 接口 + * + * @author BladeX + * @since 2022-03-07 + */ +@Repository +public interface EmployeeMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param wrapper + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + @Select("SELECT * FROM T_EMPLOYEE ${ew.customSqlSegment} ORDER BY DEPT_ID,EMPLOYEE_NO") + IPage selectEmployeePage(IPage page, @Param(Constants.WRAPPER) Wrapper wrapper); + + + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + @Select("SELECT * FROM T_EMPLOYEE ${ew.customSqlSegment}") + List selectEmployeeData(@Param(Constants.WRAPPER) LambdaQueryWrapper employeeQueryWrapper); + + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List getEmployeeStatisticsData(@Param("employeeDTO") EmployeeDTO employeeDTO); + + /** + * 更新用户同步流水表信息 + * @param empNo 员工编号, + * @param isSeconded 是否借调 + * @return + */ + boolean updateUserHistory(@Param("empNo") String empNo, @Param("isSeconded") String isSeconded); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/EmployeeMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/EmployeeMapper.xml new file mode 100644 index 0000000..308c715 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/EmployeeMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update t_user_sync_history set is_seconded = #{isSeconded} where empe_num = #{empNo} + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/FamilyMapper.java b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/FamilyMapper.java new file mode 100644 index 0000000..1ad6983 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/FamilyMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.mapper; + +import org.security.ht.entity.basic.Family; +import org.security.ht.vo.basic.FamilyVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 基础信息-员工家庭成员 Mapper 接口 + * + * @author BladeX + * @since 2022-03-08 + */ +public interface FamilyMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param family + * @return + */ + List selectFamilyPage(IPage page, FamilyVO family); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/FamilyMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/FamilyMapper.xml new file mode 100644 index 0000000..407562f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/FamilyMapper.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/JobRecordMapper.java b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/JobRecordMapper.java new file mode 100644 index 0000000..30586ef --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/JobRecordMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.mapper; + +import org.security.ht.entity.basic.JobRecord; +import org.security.ht.vo.basic.JobRecordVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 基础信息-员工工作履历 Mapper 接口 + * + * @author BladeX + * @since 2022-03-08 + */ +public interface JobRecordMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param jobRecord + * @return + */ + List selectJobRecordPage(IPage page, JobRecordVO jobRecord); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/JobRecordMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/JobRecordMapper.xml new file mode 100644 index 0000000..9466875 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/JobRecordMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/LawMapper.java b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/LawMapper.java new file mode 100644 index 0000000..d7c3123 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/LawMapper.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.security.ht.entity.basic.Law; +import org.security.ht.vo.basic.LawVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * Mapper 接口 + * + * @author BladeX + * @since 2022-05-30 + */ +public interface LawMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param wrapper + * @return + */ + @Select("SELECT * FROM T_LAW ${ew.customSqlSegment}") + IPage selectLawPage(IPage page, @Param(Constants.WRAPPER) Wrapper wrapper); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/LawMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/LawMapper.xml new file mode 100644 index 0000000..65f765e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/LawMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/MailListMapper.java b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/MailListMapper.java new file mode 100644 index 0000000..c2a35fb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/MailListMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.mapper; + +import org.security.ht.entity.basic.MailList; +import org.security.ht.vo.basic.MailListVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 基础信息-联系信息表 Mapper 接口 + * + * @author BladeX + * @since 2022-05-18 + */ +public interface MailListMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param mailList + * @return + */ + List selectMailListPage(IPage page, MailListVO mailList); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/MailListMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/MailListMapper.xml new file mode 100644 index 0000000..7b39fbf --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/MailListMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/SelfHelpBankMapper.java b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/SelfHelpBankMapper.java new file mode 100644 index 0000000..9d597bf --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/SelfHelpBankMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.mapper; + +import org.security.ht.entity.basic.SelfHelpBank; +import org.security.ht.vo.basic.SelfHelpBankVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 基础信息-自助银行 Mapper 接口 + * + * @author BladeX + * @since 2022-03-16 + */ +public interface SelfHelpBankMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param selfHelpBank + * @return + */ + List selectSelfHelpBankPage(IPage page, SelfHelpBankVO selfHelpBank); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/SelfHelpBankMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/SelfHelpBankMapper.xml new file mode 100644 index 0000000..9d34dc7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/mapper/SelfHelpBankMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/IDepartmentService.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IDepartmentService.java new file mode 100644 index 0000000..9ce1eff --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IDepartmentService.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service; + +import org.security.trans.basic.dto.DepartmentDTO; +import org.security.ht.entity.basic.Department; +import org.security.ht.vo.basic.DepartmentVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.ht.vo.basic.DeptDataVO; +import org.security.ht.vo.basic.MapDeptDataVO; +import org.security.ht.vo.basic.RoleDataVO; +import org.springblade.core.tool.api.R; + +import java.util.List; +import java.util.Map; + +/** + * 基础信息-组织机构 服务类 + * + * @author BladeX + * @since 2022-03-07 + */ +public interface IDepartmentService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param department + * @return + */ + IPage selectDepartmentPage(IPage page, DepartmentVO department); + + /** + * 懒加载树 + * @param param + * @param parentId + * @return + */ + List lazyList(Map param, String parentId); + /** + * 懒加载树for任务下发 + * @param param + * @param parentId + * @return + */ + List lazyListForTask(Map param, String parentId); + + /** + * 根据id获取详情 + * @param id + * @return + */ + DeptDataVO getDepartmentById(Long id); + + /** + * 联级选择器树结构 + * @return + */ + List cascadeSelection(); + + /** + * 部门树 + * @param departmentDTO + * @return + */ + List tree(DepartmentDTO departmentDTO); + + + /** + * 完善机构资料 + * @param departmentDTO 机构明细资料 + * @return + */ + boolean updateDeptData(DepartmentDTO departmentDTO); + /** + * 完善机构资料 + * @param departmentDTO 机构明细资料 + * @return + */ + R addSelfBank(DepartmentDTO departmentDTO); + + /** + * 根据部门id获取相关角色id + * @param deptId + */ + List getData(String deptId); + + /** + * 根据topDeptId获取子级部门树 + * @param topDeptId + * @return + */ + List getChildDeptTree(String topDeptId); + + /** + * 获取机构地图数据 + * @return + */ + List getDeptMapDetail(); + + /** + * 消息总线信息同步,更新机构信息 + * @param departmentList + * @return + */ + boolean saveDepartmentData(List departmentList); + + List getSelfBankData(); + + List getBudgetDept(); + /** + * 删除机构 + * @param ids 机构ids + * @return + */ + boolean removeDept(String ids); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/IDeviceService.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IDeviceService.java new file mode 100644 index 0000000..20c576d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IDeviceService.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.system.dto.MenuDTO; +import org.security.system.vo.MenuVO; +import org.security.trans.basic.dto.DeviceDTO; +import org.security.ht.entity.basic.Device; +import org.security.ht.vo.basic.DeviceVO; +import org.security.trans.dataStatistics.entity.DeviceData; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * 基础信息-设备信息 服务类 + * + * @author BladeX + * @since 2022-03-16 + */ +public interface IDeviceService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param deviceDto + * @return + */ + IPage selectDevicePage(IPage page, DeviceDTO deviceDto); + + DeviceVO getDeviceById(Long id); + + Boolean saveDevice(DeviceDTO deviceDTO); + + /** + * 分页查询使用、超期使用设备 + * @param query + * @return + */ + IPage getCheckList(Query query); + + /** + * 生成二维码 + * @param toLongList 设备id + * @return + */ + boolean createQrCode(List toLongList); + /** + * 处置设备 + * @param toLongList 设备id + * @return + */ + R disposalByIds(List toLongList); + + /** + * 获取设备统计旭日图统计数据 + */ + List getRisSunChartData(List aimDepts); + /** + * 获取设备统计-按机构分布数据 + */ + List getPieDeptData(String aimDept); + /** + * 批量导入设备信息 + */ + R importData(MultipartFile file); + /** + * 查询当前正在使用中的设备 + */ + List getUsingList(); + /** + * 删除设备 + */ + R removeDevice(List ids); + /** + * 删除设备 + */ + R getMenuDetail(MenuDTO menuDTO); + /** + * 根据角色ids查询菜单ids + * + * @param roleIds + * @return + */ + List roleMenuTreeKeys(String roleIds); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/IEmployeeService.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IEmployeeService.java new file mode 100644 index 0000000..3a0833a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IEmployeeService.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service; + +import org.security.trans.basic.dto.EmployeeDTO; +import org.security.ht.entity.basic.Employee; +import org.security.ht.vo.basic.EmployeeVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * 基础信息-员工 服务类 + * + * @author BladeX + * @since 2022-03-07 + */ +public interface IEmployeeService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param employeeDTO + * @return + */ + IPage selectEmployeePage(IPage page, EmployeeDTO employeeDTO); + + /** + * 新增员工信息及关联家庭成员、工作履历信息 + * @param employeeDTO + * @return boolean + */ + boolean saveEmployeeAndFamiliesAndJobRecords(EmployeeDTO employeeDTO); + + /** + * 逻辑删除员工信息及关联家庭成员、工作履历信息 + * @param ids + * @return boolean + */ + boolean removeEmployeeAndFamiliesAndJobRecords(List ids); + /** + * 逻辑删除员工信息及关联家庭成员、工作履历信息 + * @param employeeDTO + * @return boolean + */ + boolean updateEmployeeAndFamiliesAndJobRecords(EmployeeDTO employeeDTO); + + /** + * 获取单个员工信息及关联家庭成员、工作履历信息 + * @param id + * @return boolean + */ + EmployeeVO getEmployeeAndFamiliesAndJobRecords(String id); + + EmployeeVO getLeaderByDeptId(); + + /** + * 消息总线同步用户信息-t_employee + * @param employees 员工信息 + * @return + */ + boolean synEmployeeData(List employees); + + + List getEmployeeStatisticsData(EmployeeDTO employeeDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/IFamilyService.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IFamilyService.java new file mode 100644 index 0000000..006b7a0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IFamilyService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service; + +import org.security.ht.entity.basic.Family; +import org.security.ht.vo.basic.FamilyVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 基础信息-员工家庭成员 服务类 + * + * @author BladeX + * @since 2022-03-08 + */ +public interface IFamilyService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param family + * @return + */ + IPage selectFamilyPage(IPage page, FamilyVO family); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/IJobRecordService.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IJobRecordService.java new file mode 100644 index 0000000..03c8473 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IJobRecordService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service; + +import org.security.ht.entity.basic.JobRecord; +import org.security.ht.vo.basic.JobRecordVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 基础信息-员工工作履历 服务类 + * + * @author BladeX + * @since 2022-03-08 + */ +public interface IJobRecordService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param jobRecord + * @return + */ + IPage selectJobRecordPage(IPage page, JobRecordVO jobRecord); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/ILawService.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/ILawService.java new file mode 100644 index 0000000..3bb28b6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/ILawService.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service; + +import org.security.trans.basic.dto.LawDTO; +import org.security.ht.entity.basic.Law; +import org.security.ht.vo.basic.LawVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.tool.api.R; + +import java.math.BigDecimal; + +/** + * 服务类 + * + * @author BladeX + * @since 2022-05-30 + */ +public interface ILawService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param lawDTO + * @return + */ + IPage selectLawPage(IPage page, LawDTO lawDTO); + + LawVO getLawById(BigDecimal id); + + R saveLaw(LawDTO lawDTO); + + R submit(LawDTO lawDTO); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/IMailListService.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IMailListService.java new file mode 100644 index 0000000..1c3b717 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/IMailListService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service; + +import org.security.ht.entity.basic.MailList; +import org.security.ht.vo.basic.MailListVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 基础信息-联系信息表 服务类 + * + * @author BladeX + * @since 2022-05-18 + */ +public interface IMailListService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param mailList + * @return + */ + IPage selectMailListPage(IPage page, MailListVO mailList); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/ISelfHelpBankService.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/ISelfHelpBankService.java new file mode 100644 index 0000000..3bb053b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/ISelfHelpBankService.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service; + +import org.security.trans.basic.dto.SelfHelpBankDTO; +import org.security.ht.entity.basic.SelfHelpBank; +import org.security.ht.vo.basic.SelfHelpBankVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 基础信息-自助银行 服务类 + * + * @author BladeX + * @since 2022-03-16 + */ +public interface ISelfHelpBankService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param selfHelpBankDTO + * @return + */ + IPage selectSelfHelpBankPage(IPage page, SelfHelpBankDTO selfHelpBankDTO); + + SelfHelpBankVO getSelfHelpBankById(Long id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/DepartmentServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/DepartmentServiceImpl.java new file mode 100644 index 0000000..23edeb1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/DepartmentServiceImpl.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service.impl; + +import com.alibaba.cloud.commons.lang.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import org.security.ht.vo.basic.*; +import org.security.system.cache.SysCache; +import org.security.system.entity.Dept; +import org.security.trans.basic.dto.DepartmentDTO; +import org.security.ht.entity.basic.Department; +import org.security.trans.basic.mapper.DepartmentMapper; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.basic.service.IEmployeeService; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.UploadVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.node.ForestNodeMerger; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 基础信息-组织机构 服务实现类 + * + * @author BladeX + * @since 2022-03-07 + */ +@Service +@AllArgsConstructor +public class DepartmentServiceImpl extends ServiceImpl implements IDepartmentService { + + private final IFileService fileService; + + @Override + public IPage selectDepartmentPage(IPage page, DepartmentVO department) { + return page.setRecords(baseMapper.selectDepartmentPage(page, department)); + } + + @Override + public List lazyList(Map param, String parentId) { + String PARENT_ID = "parentId"; + // 判断点击搜索但是没有查询条件的情况 + if (Func.isEmpty(param.get(PARENT_ID)) && param.size() == 1) { + parentId = "0"; + } + // 判断数据权限控制,非超管角色只可看到本级及以下数据 + if (Func.toLong(parentId) == 0L && !AuthUtil.isAdministrator()) { + Long deptId = Func.firstLong(AuthUtil.getDeptId()); + Dept dept = SysCache.getDept(deptId); + if (dept.getParentId() != 0) { + parentId = String.valueOf(dept.getParentId()); + } + } + // 判断点击搜索带有查询条件的情况 + if (Func.isEmpty(param.get(PARENT_ID)) && param.size() > 1 && Func.toLong(parentId) == 0L) { + parentId = null; + } + List list = baseMapper.lazyList(parentId, param); + List collect = list.stream().peek(dept -> { + }).collect(Collectors.toList()); + return ForestNodeMerger.merge(collect); + } + + @Override + public List lazyListForTask(Map param, String parentId) { + List list = baseMapper.lazyListForTask(parentId, param); + List collect = list.stream().peek(dept -> { + }).collect(Collectors.toList()); + return ForestNodeMerger.merge(collect); + } + + @Override + public DeptDataVO getDepartmentById(Long id) { + Department department = this.getById(id); + DeptDataVO deptDataVO = Func.copy(department, DeptDataVO.class); +// 查询上级机构名称 + Long rootParentId = new Long(0); + deptDataVO.setParentName(Func.isNotEmpty(department.getParentId()) && !rootParentId.equals(department.getParentId())?this.getById(department.getParentId()).getDeptName():""); + //获取相关附件 + List attachments = fileService.getAttachments(String.valueOf(id), department.getGroupName()); + List attachmentsLicense = fileService.getAttachments(String.valueOf(id), department.getQuaGroupName()); +// 查询机构人数 2023-7-20根据最新需求变更单,机构人数改为手填,不进行自动计算 +// List employeeVOS= baseMapper.getEmployee(String.valueOf(id)); +// deptDataVO.setPeopleNumber(employeeVOS.size()); + assert deptDataVO != null; + deptDataVO.setDeptDisList(attachments); + deptDataVO.setDeptLicenseList(attachmentsLicense); + return deptDataVO; + } + + @Override + public List cascadeSelection() { + String deptId = AuthUtil.getDeptId(); + List departmentVOList = this.baseMapper.cascade(deptId); + return ForestNodeMerger.merge(departmentVOList); + } + + @Override + public List tree(DepartmentDTO departmentDTO) { + //地图页面跳转到机构列表获取相关数据 + if (Func.isNotEmpty(departmentDTO.getId())) { + ArrayList list = new ArrayList<>(); + Department department = this.getById(departmentDTO.getId()); + DepartmentVO departmentVO = Func.copy(department, DepartmentVO.class); + list.add(departmentVO); + return list; + } + String deptId = AuthUtil.getDeptId(); + String id; + if (StringUtils.isNotBlank(departmentDTO.getDeptLevel()) || StringUtils.isNotBlank(departmentDTO.getDeptName())) { + id = null; + } else { + id = deptId; + } + QueryWrapper beforeQueryWrapper = new QueryWrapper<>(); + beforeQueryWrapper.lambda().like(Department::getAncestors, deptId); + List childrenList = this.list(beforeQueryWrapper); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if ((StringUtils.isNotBlank(departmentDTO.getDeptLevel()) || StringUtils.isNotBlank(departmentDTO.getDeptName())) && childrenList.isEmpty()) { + queryWrapper.lambda() + .eq(Department::getId, deptId); + } else { + queryWrapper.lambda() + .eq(StringUtils.isNotBlank(id), Department::getId, id) + .or() + .like(Department::getAncestors, deptId); + } + queryWrapper.lambda() + .eq(StringUtils.isNotBlank(departmentDTO.getDeptLevel()), Department::getDeptLevel, departmentDTO.getDeptLevel()) + .like(StringUtils.isNotBlank(departmentDTO.getDeptName()), Department::getDeptName, departmentDTO.getDeptName()); + List departmentList = this.list(queryWrapper); + List voList = Func.copy(departmentList, DepartmentVO.class); + return ForestNodeMerger.merge(voList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateDeptData(DepartmentDTO departmentDTO) { + Department department = Func.copy(departmentDTO, Department.class); + //保存机构信息 + boolean b1 = this.updateById(department); + //将机构相关照片保存到附件表 + fileService.saveAttachments(departmentDTO.getDeptDisList(), String.valueOf(department.getId())); + //将机构证件照片保存到附件表 + fileService.saveAttachments(departmentDTO.getDeptLicenseList(), String.valueOf(department.getId())); + return b1; + } + + @Override + public List getData(String deptId) { + return baseMapper.getData(deptId); + } + + @Override + public List getChildDeptTree(String topDeptId) { + List departmentVOList = this.baseMapper.cascade(topDeptId); + return ForestNodeMerger.merge(departmentVOList); + } + + @Override + public List getDeptMapDetail() { + ArrayList vos = new ArrayList<>(); + List list = this.list(); + //筛选出经纬度都不为空的相关机构信息 + List collect = list.stream().filter(item -> Func.isNotEmpty(item.getLongitude()) && Func.isNotEmpty(item.getLatitude())).collect(Collectors.toList()); + if (Func.isNotEmpty(collect)) { + collect.forEach(item -> { + MapDeptDataVO dataVO = new MapDeptDataVO(); + dataVO.setId(String.valueOf(item.getId())); + dataVO.setDeptName(item.getDeptName()); + dataVO.setCoordinate(item.getLongitude().concat(",").concat(item.getLatitude())); + dataVO.setLongitude(item.getLongitude()); + dataVO.setLatitude(item.getLatitude()); + dataVO.setCategory(item.getDeptCategory()); + vos.add(dataVO); + }); + } + return vos; + } + + @Override + public boolean saveDepartmentData(List departmentList) { + return this.saveOrUpdateBatch(departmentList); + } + + @Override + public List getSelfBankData() { + return baseMapper.getSelfBankData(AuthUtil.getDeptId()); + } + + @Override + public List getBudgetDept() { + return this.list(new QueryWrapper().lambda().eq(Department::getDeptCategory,"6")); + } + + @Override + public R addSelfBank(DepartmentDTO departmentDTO) { + if (Func.isEmpty(departmentDTO.getParentId())) { + return R.fail("请务必选择所属网点"); + } + if (Func.isEmpty(departmentDTO.getDeptCategory())) { + departmentDTO.setDeptCategory("4"); + } + //赋值祖级id + List list = setAncestors(departmentDTO); + departmentDTO.setAncestors(org.apache.commons.lang.StringUtils.join(list, ",")); + Department department = Func.copy(departmentDTO, Department.class); + super.save(department); + //将机构相关照片保存到附件表 + fileService.saveAttachments(departmentDTO.getDeptDisList(), String.valueOf(department.getId())); + return R.success("操作成功"); + } + + /** + *赋值祖级id + */ + private List setAncestors(DepartmentDTO departmentDTO) { + List list = new ArrayList<>(); + String aimDeptId = String.valueOf(departmentDTO.getParentId()); + while (true) { + if (Func.isNotEmpty(aimDeptId) && !("0".equals(aimDeptId))) { + Department department = this.getById(aimDeptId); + list.add(String.valueOf(department.getParentId())); + aimDeptId = String.valueOf(department.getParentId()); + } else { + break; + } + } + list.add(0, "0"); + list.add(1, String.valueOf(departmentDTO.getParentId())); + return list; + } + + @Override + public boolean removeDept(String ids) { +// Integer cnt = baseMapper.selectCount(Wrappers.query().lambda().in(Department::getParentId, Func.toLongList(ids))); +// if (cnt > 0) { +// throw new ServiceException("请先删除子节点!"); +// } + return removeByIds(Func.toLongList(ids)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/DeviceServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/DeviceServiceImpl.java new file mode 100644 index 0000000..9c28810 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/DeviceServiceImpl.java @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.security.common.Constant; +import org.security.common.util.ExcelUtil; +import org.security.ht.vo.common.UploadVO; +import org.security.system.dto.MenuDTO; +import org.security.system.entity.Menu; +import org.security.system.entity.RoleMenu; +import org.security.system.vo.MenuVO; +import org.security.trans.basic.dto.DeviceDTO; +import org.security.ht.entity.basic.Department; +import org.security.ht.entity.basic.Device; +import org.security.trans.basic.dto.DeviceExcelDTO; +import org.security.trans.basic.mapper.DeviceMapper; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.basic.service.IDeviceService; +import org.security.ht.vo.basic.DeviceVO; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dataStatistics.entity.DeviceData; +import org.security.trans.dataStatistics.service.impl.InspectionDataServiceImpl; +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.service.IDeviceCategorySettingsService; +import org.security.trans.settings.vo.DeviceCategorySettingsVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +import static org.security.common.Constant.*; + +/** + * 基础信息-设备信息 服务实现类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Service +@Scope("prototype") +@AllArgsConstructor +@Slf4j +public class DeviceServiceImpl extends ServiceImpl implements IDeviceService { + + private IDepartmentService departmentService; + + private IDeviceCategorySettingsService deviceCategorySettingsService; + + private final IFileService fileService; + private final InspectionDataServiceImpl inspectionDataService; + + @Override + public IPage selectDevicePage(IPage page, DeviceDTO deviceDto) { + List aimDepts = inspectionDataService.setDeptIds(deviceDto.getDepId(), deviceDto.getIncludeChildren()); +// String depId = null; +// if (StringUtils.isNotBlank(deviceDto.getDepId())) { +// List depIdList = Func.toStrList(deviceDto.getDepId()); +// depId = depIdList.get(depIdList.size() - 1); +// } + Page devicePage = new Page<>(page.getCurrent(), page.getSize()); + QueryWrapper deviceQueryWrapper = new QueryWrapper<>(); + deviceQueryWrapper.lambda().eq(Device::getDelFlag, DELETE_FLAG_0); + //请求来自设备检查页面 + if ("0".equals(deviceDto.getFlag())) { + deviceQueryWrapper.lambda() +// .eq(StringUtils.isNotBlank(depId), Device::getDepId, depId) + .in(Func.isNotEmpty(aimDepts), Device::getDepId, aimDepts) + .like(StringUtils.isNotBlank(deviceDto.getTypeRank()), Device::getTypeRank, deviceDto.getTypeRank()) + .like(StringUtils.isNotBlank(deviceDto.getName()), Device::getName, deviceDto.getName()) + .like(StringUtils.isNotBlank(deviceDto.getDeviceNum()), Device::getDeviceNum, deviceDto.getDeviceNum()) + .in(Device::getUsageState, DEVICE_STATE_DUSE, DEVICE_STATE_USE, DEVICE_STATE_OVERTIME_USE) + .orderByAsc(Device::getDepId) + .orderByAsc(Device::getDeviceNum); + } else { + deviceQueryWrapper.lambda() +// .eq(StringUtils.isNotBlank(depId), Device::getDepId, depId) + .in(Func.isNotEmpty(aimDepts), Device::getDepId, aimDepts) + .eq(StringUtils.isNotBlank(deviceDto.getState()), Device::getState, deviceDto.getState()) + .eq(StringUtils.isNotBlank(deviceDto.getUsageState()), Device::getUsageState, deviceDto.getUsageState()) + .eq(StringUtils.isNotBlank(deviceDto.getDeviceState()), Device::getDeviceState, deviceDto.getDeviceState()) + .eq(StringUtils.isNotBlank(deviceDto.getAutoCheck()), Device::getAutoCheck, deviceDto.getAutoCheck()) + .eq(StringUtils.isNotBlank(deviceDto.getNeedScan()), Device::getNeedScan, deviceDto.getNeedScan()) + .like(StringUtils.isNotBlank(deviceDto.getTypeRank()), Device::getTypeRank, deviceDto.getTypeRank()) + .like(StringUtils.isNotBlank(deviceDto.getName()), Device::getName, deviceDto.getName()) + .like(StringUtils.isNotBlank(deviceDto.getDeviceNum()), Device::getDeviceNum, deviceDto.getDeviceNum()) + .orderByAsc(Device::getDepId) + .orderByAsc(Device::getDeviceNum); + } + IPage resultPage = this.baseMapper.selectDevicePage(devicePage, deviceQueryWrapper); + final List records = resultPage.getRecords(); + List deviceVOList = new ArrayList<>(); + if (!Func.isNull(records) && records.size() > 0) { + records.forEach(item -> { + DeviceVO deviceVO = Func.copy(item, DeviceVO.class); + DeviceCategorySettings deviceCategorySettings = deviceCategorySettingsService.getById(item.getTypeId()); + deviceVO.setTypeName(!Func.isNull(deviceCategorySettings) ? deviceCategorySettings.getName() : ""); + assert deviceVO != null; + deviceVOList.add(deviceVO); + }); + } + return new Page() + .setSize(resultPage.getSize()) + .setCurrent(resultPage.getCurrent()) + .setTotal(resultPage.getTotal()) + .setRecords(deviceVOList); + } + + @Override + public DeviceVO getDeviceById(Long id) { + Device device = this.getById(id); + DeviceVO deviceVO = Func.copy(device, DeviceVO.class); + assert deviceVO != null; + List typeRankList = Func.toStrList(device.getTypeRank()); + deviceVO.setTypeRankList(typeRankList); + if(Func.isNotEmpty(device.getTypeId())){ + DeviceCategorySettings deviceCategorySettings = deviceCategorySettingsService.getById(device.getTypeId()); + deviceVO.setTypeName(Func.isNotEmpty(deviceCategorySettings) ? deviceCategorySettings.getName() : ""); + } + Department department = departmentService.getById(device.getDepId()); +// 返回级联框显示所用的部门id list + if(!Func.isNull(department)){ + List deptIdList = Func.toLongList(department.getAncestors()); + List collect = deptIdList.stream().filter(item -> !item.equals(deptIdList.get(0))).collect(Collectors.toList()); +// 数据库存储的Ancestors顺序是祖辈级别越高越靠后,需要先进行逆序 + Collections.reverse(collect); +// 逆序后祖辈级id从高到低,此时再加上设备所属本级机构 + collect.add(department.getId()); + deviceVO.setDeptIdList(collect); + } + deviceVO.setPicList(fileService.getAttachments(device.getId(),device.getGroupName())); + return deviceVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean saveDevice(DeviceDTO deviceDTO) { + List typeRankList = Func.toStrList(deviceDTO.getTypeRank()); + if(Func.isNotEmpty(typeRankList)){ + deviceDTO.setTypeId(typeRankList.get(typeRankList.size() - 1)); + } +// 如果是批量编辑的更新,不进行编号唯一校验 + if("batchEdit".equals(deviceDTO.getFlag())){ + if (Func.isNotEmpty(deviceDTO.getDepId())){ + Department department = departmentService.getById(deviceDTO.getDepId()); + if (Func.isNotEmpty(department)){ + deviceDTO.setDeptName(department.getDeptName()); + } + } + this.saveOrUpdate(deviceDTO); + //保存附件 + List fileList = deviceDTO.getPicList(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, deviceDTO.getId()); + } + return true; + } + else{ +// 对设备编号进行唯一校验 + if(!Func.isNull(deviceDTO.getDeviceNum())){ + List deviceList=checkDeviceNum(deviceDTO.getDeviceNum()); + if(deviceList.size()>0 &&(Func.isNull(deviceDTO.getId()) || !Func.isNull(deviceDTO.getId()) && !deviceList.get(0).getId().equals(deviceDTO.getId()))){ + throw new ServiceException(StringUtil.format("设备编号【{}】重复!无法保存",deviceDTO.getDeviceNum())); + } + } + + + if (Func.isEmpty(deviceDTO.getDepId())){ + deviceDTO.setDepId(AuthUtil.getDeptId()); + } + Department department = departmentService.getById(deviceDTO.getDepId()); + + Device device = Func.copy(deviceDTO, Device.class); + if (Func.isNotEmpty(department)){ + device.setDeptName(department.getDeptName()); + } + //获取设备关联设备类型的检查频率 + if(Func.isNotEmpty(device.getTypeId())){ + DeviceCategorySettings deviceCategorySettings = deviceCategorySettingsService.getById(device.getTypeId()); + device.setFrequency(Func.isNotEmpty(deviceCategorySettings) ? deviceCategorySettings.getCheckFreq() : null); + } + this.saveOrUpdate(device); + //若是新增,生成设备二维码所需字符串 + if(Func.isNull(device.getQrCode()) || Func.isBlank(device.getQrCode())){ + device.setQrCode(device.getId().concat("-").concat(Func.formatDateTime(new Date()))); + this.updateById(device); + } + //保存附件 + List fileList = deviceDTO.getPicList(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, device.getId()); + } + return true; + } + } + + @Override + public IPage getCheckList(Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("USAGE_STATE", DEVICE_STATE_OVERTIME_USE,DEVICE_STATE_USE); + Page page = new Page<>(query.getCurrent(), query.getSize()); + return baseMapper.selectPage(page, queryWrapper); + } + + @Override + public boolean createQrCode(List toLongList) { + //生成base64格式二维码 +// HashMap hashMap = new HashMap<>(); +// ArrayList list = new ArrayList<>(); +// if (Func.isNotEmpty(toLongList)){ +// toLongList.forEach(item->{ +// //生成二维码 +// String qrCode = QrCodeUtil.createQrCode(String.valueOf(item)); +// hashMap.put(String.valueOf(item),qrCode); +// //根据id获取设备信息 +// Device device = this.getById(item); +// list.add(device); +// }); +// //更新设备二维码信息 +// if (Func.isNotEmpty(list)){ +// list.forEach(item->{ +// item.setQrCode(hashMap.get(item.getId())); +// }); +// } +// return this.saveOrUpdateBatch(list); +// } +// return false; + + //更新二维码 + ArrayList list = new ArrayList<>(); + if (Func.isNotEmpty(toLongList)) { + toLongList.forEach(item -> { + //根据id获取设备信息 + Device device = this.getById(item); + list.add(device); + }); + } + //生成二维码所需字符串 + if (Func.isNotEmpty(list)) { + list.forEach(item -> { + item.setQrCode(item.getId().concat("-").concat(Func.formatDateTime(new Date()))); + }); + } + return this.saveOrUpdateBatch(list); + } + + @Override + public R disposalByIds(List toLongList) { + ArrayList list = new ArrayList<>(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String endDate = formatter.format(DateUtil.now()); + if (Func.isNotEmpty(toLongList)) { + toLongList.forEach(item -> { + //根据id获取设备信息 + Device device = this.getById(item); + list.add(device); + }); + } + if (Func.isNotEmpty(list)) { + list.forEach(item -> { + item.setUsageState(DEVICE_STATE_DISPOSED); + item.setEndDate(endDate); + }); + } + return R.status(this.saveOrUpdateBatch(list)); + } + + @Override + public List getRisSunChartData(List aimDepts) { + return baseMapper.getRisSunChartData(aimDepts); + } + @Override + public List getPieDeptData(String aimDept) { + return baseMapper.getPieDataByDeptId(aimDept); + } + + /** + * 导入设备 + * + * @param file 文件内容 + * @return + */ + @Override + public R importData(MultipartFile file) { + log.info("---------导入设备--------"); + ArrayList lines = new ArrayList<>(); + //读取excel文件内容 + List list = ExcelUtil.read(file, DeviceExcelDTO.class); + if (Func.isNotEmpty(list)) { + list.forEach(item -> { + DeviceDTO device = Func.copy(item, DeviceDTO.class); + //根据导入文件的设备编号校验是否重复导入 + if(checkDeviceNum(item.getDeviceNum()).size()>0){ + throw new ServiceException(StringUtil.format("设备编号【{}】重复!无法导入",item.getDeviceNum())); + } +// 设备归属部门id,默认取当前登录人员所属部门 + device.setDepId(AuthUtil.getDeptId()); +// 根据导入文件的设备类型名称查找设备类型id并赋值给设备对应字段 + DeviceDTO deviceDTO = getDeviceCategory(item.getTypeName()); + + device.setTypeId(deviceDTO.getTypeId()); + device.setTypeRank(deviceDTO.getTypeRank()); +// 设备使用状态 + String deviceSt =null; + switch (item.getUsageStateName()) { + //0-未使用 1-正常使用中 2-超期使用中 3-已处置 + case "未使用": + deviceSt = "0"; + break; + case "正常使用中": + deviceSt = "1"; + break; + case "超期使用中": + deviceSt = "2"; + break; + case "已处置": + deviceSt = "3"; + break; + default: + throw new ServiceException(StringUtil.format("系统不支持设备使用状态描述:【{}】,请核对后修改再试!",item.getUsageStateName())); + } + device.setUsageState(deviceSt);//设备使用状态 + device.setDeviceState("1");//设备状态 1-正常 +// lines.add(device); + saveDevice(device); + }); + } + return R.success("导入成功"); + } + + /** + * 根据设备类型名称查询出对应设备类型并组DeviceDTO + * @param catgName + * @return + */ + public DeviceDTO getDeviceCategory(String catgName) { + DeviceDTO deviceDTO = new DeviceDTO(); + List dcVos = deviceCategorySettingsService.getCgListByName(catgName); + if (dcVos.size()>0){ + deviceDTO.setTypeId(dcVos.get(0).getId().toString()); + deviceDTO.setTypeRank(dcVos.get(0).getReserve1().concat(",").concat(dcVos.get(0).getId().toString())); + }else{ + throw new ServiceException(StringUtil.format("无法查询到设备类型【{}】",catgName)); + } + return deviceDTO; + } + public List checkDeviceNum(String deviceNum){ + Query query = new Query(); + DeviceDTO device = new DeviceDTO(); + device.setDeviceNum(deviceNum); + device.setDelFlag("0"); + IPage pages = this.page(Condition.getPage(query), Condition.getQueryWrapper(device)); + return pages.getRecords(); + } + @Override + public List getUsingList(){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("USAGE_STATE", DEVICE_STATE_USE); + queryWrapper.eq("DEL_FLAG",Constant.DELETE_FLAG_0); + queryWrapper.eq("AUTO_CHECK", "1"); + return baseMapper.selectList(queryWrapper); + } + + @Override + public R removeDevice(List toLongList) { + if (Func.isNotEmpty(toLongList)) { + toLongList.forEach(item -> { + String deviceId = String.valueOf(item); + //查询该设备相关的未删除的设备检查记录 + List deviceInspectionList = baseMapper.deviceInspectionList(deviceId); + if(deviceInspectionList.size()>0){ + log.info("=====设备【{}】存在设备检查记录,无法删除",item); + throw new ServiceException("当前设备存在设备检查记录,无法删除"); + } + }); + } + + return R.status(this.removeByIds(toLongList)); + } + + @Override + public R getMenuDetail(MenuDTO menuDTO) { + List menuList = baseMapper.getMenuDetail(menuDTO); + MenuVO menuVO = new MenuVO(); + if (Func.isNotEmpty(menuList)) { + menuVO = Func.copy(menuList.get(0), MenuVO.class); + } + return R.data(menuVO); + } + + @Override + public List roleMenuTreeKeys(String roleIds) { + List roleMenus = baseMapper.getRoleMenulist(Func.toStrList(roleIds)); + return roleMenus.stream().map(roleMenu -> Func.toStr(roleMenu.getMenuId())).collect(Collectors.toList()); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/EmployeeServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/EmployeeServiceImpl.java new file mode 100644 index 0000000..1f384a7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/EmployeeServiceImpl.java @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.security.trans.basic.dto.EmployeeDTO; +import org.security.ht.entity.basic.Department; +import org.security.ht.entity.basic.Employee; +import org.security.ht.entity.basic.Family; +import org.security.ht.entity.basic.JobRecord; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.basic.service.IFamilyService; +import org.security.trans.basic.service.IJobRecordService; +import org.security.ht.vo.basic.EmployeeVO; +import org.security.trans.basic.mapper.EmployeeMapper; +import org.security.trans.basic.service.IEmployeeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dataStatistics.service.impl.InspectionDataServiceImpl; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +import static org.security.common.Constant.*; + +/** + * 基础信息-员工 服务实现类 + * + * @author BladeX + * @since 2022-03-07 + */ +@Service +@AllArgsConstructor +@Slf4j +public class EmployeeServiceImpl extends ServiceImpl implements IEmployeeService { + private final IDepartmentService departmentService; + private final IFamilyService familyService; + private final IJobRecordService jobRecordService; + private final IFileService fileService; + private final InspectionDataServiceImpl inspectionDataService; + + @Override + public IPage selectEmployeePage(IPage page, EmployeeDTO employeeDTO) { +// String deptId = null; +// if (StringUtils.isNotBlank(employeeDTO.getDeptId())) { +// List deptIds = Func.toLongList(employeeDTO.getDeptId()); +// deptId = String.valueOf(deptIds.get(deptIds.size() - 1)); +// } + List aimDepts = inspectionDataService.setDeptIds(employeeDTO.getDeptId(), employeeDTO.getIncludeChildren()); + Page employeePage = new Page<>(page.getCurrent(), page.getSize()); + LambdaQueryWrapper employeeQueryWrapper = setQueryWrappers(employeeDTO, aimDepts); + IPage resultPage = this.baseMapper.selectEmployeePage(employeePage, employeeQueryWrapper); + List employeeList = resultPage.getRecords(); + List collect = employeeList.stream().filter(item -> Func.isNotEmpty(item.getDeptId())).collect(Collectors.toList()); + List employeeVOList = new ArrayList<>(); + collect.forEach(emp -> setDataVO(employeeVOList, emp)); + return new Page() + .setRecords(employeeVOList) + .setTotal(resultPage.getTotal()) + .setSize(resultPage.getSize()) + .setCurrent(resultPage.getCurrent()); + } + + + /** + * 行内工龄筛选 + */ + private List screeningLengthOfService(EmployeeDTO employeeDTO, List vos) { + if (Func.isEmpty(employeeDTO.getProfessionalLengthOfService())){ + return vos; + } + //5年以下 + if (employeeDTO.getProfessionalLengthOfService() == 1){ + return vos.stream().filter(item -> item.getProfessionalLengthOfService() < 5).collect(Collectors.toList()); + } + //[5-10)年 + if (employeeDTO.getProfessionalLengthOfService() == 2){ + return vos.stream().filter(item -> item.getProfessionalLengthOfService() >= 5 && item.getProfessionalLengthOfService() < 10).collect(Collectors.toList()); + } + //[10-20}年 + if (employeeDTO.getProfessionalLengthOfService() == 3){ + return vos.stream().filter(item -> item.getProfessionalLengthOfService() >= 10 && item.getProfessionalLengthOfService() < 20).collect(Collectors.toList()); + } + //[20-30)年 + if (employeeDTO.getProfessionalLengthOfService() == 4){ + return vos.stream().filter(item -> item.getProfessionalLengthOfService() >= 20 && item.getProfessionalLengthOfService() < 30).collect(Collectors.toList()); + } + //30年及以上 + if (employeeDTO.getProfessionalLengthOfService() == 5){ + return vos.stream().filter(item -> item.getProfessionalLengthOfService() >= 30).collect(Collectors.toList()); + } + return vos; + } + + + /** + * 企业工龄条件筛选 + */ + private List screeningEnterpriseSeniority(EmployeeDTO employeeDTO, List vos) { + if (Func.isEmpty(employeeDTO.getSeniorityInEnterprise())){ + return vos; + } + //5年以下 + if (employeeDTO.getSeniorityInEnterprise() == 1){ + return vos.stream().filter(item -> item.getSeniorityInEnterprise() < 5).collect(Collectors.toList()); + } + //[5-10)年 + if (employeeDTO.getSeniorityInEnterprise() == 2){ + return vos.stream().filter(item -> item.getSeniorityInEnterprise() >= 5 && item.getSeniorityInEnterprise() < 10).collect(Collectors.toList()); + } + //[10-20}年 + if (employeeDTO.getSeniorityInEnterprise() == 3){ + return vos.stream().filter(item -> item.getSeniorityInEnterprise() >= 10 && item.getSeniorityInEnterprise() < 20).collect(Collectors.toList()); + } + //[20-30)年 + if (employeeDTO.getSeniorityInEnterprise() == 4){ + return vos.stream().filter(item -> item.getSeniorityInEnterprise() >= 20 && item.getSeniorityInEnterprise() < 30).collect(Collectors.toList()); + } + //30年及以上 + if (employeeDTO.getSeniorityInEnterprise() == 5){ + return vos.stream().filter(item -> item.getSeniorityInEnterprise() >= 30).collect(Collectors.toList()); + } + return vos; + } + + private List screeningAgeConditions(EmployeeDTO employeeDTO, List employeeVOList) { + //年龄段筛选条件为空 + if (Func.isEmpty(employeeDTO.getAgeGroup())){ + return employeeVOList; + } + //年龄段<20岁 + if (employeeDTO.getAgeGroup() == 1){ + return employeeVOList.stream().filter(item -> Integer.parseInt(item.getAge()) < 20).collect(Collectors.toList()); + } + //[20-30)岁 + if (employeeDTO.getAgeGroup() == 2){ + return employeeVOList.stream().filter(item -> Integer.parseInt(item.getAge()) >= 20 && Integer.parseInt(item.getAge()) < 30).collect(Collectors.toList()); + } + //[30-40}岁 + if (employeeDTO.getAgeGroup() == 3){ + return employeeVOList.stream().filter(item -> Integer.parseInt(item.getAge()) >= 30 && Integer.parseInt(item.getAge()) < 40).collect(Collectors.toList()); + } + //[40-50)岁 + if (employeeDTO.getAgeGroup() == 4){ + return employeeVOList.stream().filter(item -> Integer.parseInt(item.getAge()) >= 40 && Integer.parseInt(item.getAge()) < 50).collect(Collectors.toList()); + } + //50岁及以上 + if (employeeDTO.getAgeGroup() == 5){ + return employeeVOList.stream().filter(item -> Integer.parseInt(item.getAge()) >= 50).collect(Collectors.toList()); + } + return employeeVOList; + } + + /** + *构造查询条件 + */ + private LambdaQueryWrapper setQueryWrappers(EmployeeDTO employeeDTO, List deptIdList) { + return new QueryWrapper().lambda() + .eq(Employee::getDelFlag,DELETE_FLAG_0) + .in(Func.isNotEmpty(deptIdList), Employee::getDeptId, deptIdList) + .like(StringUtils.isNotBlank(employeeDTO.getName()), Employee::getName, employeeDTO.getName()) + .eq(StringUtils.isNotBlank(employeeDTO.getGender()), Employee::getGender, employeeDTO.getGender()) + .eq(StringUtils.isNotBlank(employeeDTO.getEmployeeNo()), Employee::getEmployeeNo, employeeDTO.getEmployeeNo()) + .eq(Func.isNoneBlank(employeeDTO.getEducation()),Employee:: getEducation, employeeDTO.getEducation()) + .eq(Func.isNoneBlank(employeeDTO.getPolitics()),Employee:: getPolitics, employeeDTO.getPolitics()) + .eq(Func.isNoneBlank(employeeDTO.getNation()),Employee:: getNation, employeeDTO.getNation()) + .eq(Func.isNoneBlank(employeeDTO.getIsSeconded()),Employee:: getIsSeconded, employeeDTO.getIsSeconded()) + .eq(Func.isNoneBlank(employeeDTO.getCivilAirDefenseType()),Employee::getCivilAirDefenseType, employeeDTO.getCivilAirDefenseType()); + } + + /** + *给列表返回对象赋值 + */ + private void setDataVO(List employeeVOList, Employee emp) { + Department department = departmentService.getOne(new QueryWrapper().lambda().eq(Func.isNotEmpty(emp.getDeptId()),Department::getId, emp.getDeptId())); + EmployeeVO employeeVO = Func.copy(emp, EmployeeVO.class); + employeeVO.setDepartment(department.getDeptName()); + setReturnCalculateValue(employeeVOList, emp, employeeVO); + } + + /** + *给统计返回对象赋值 + */ + private void setDataVO2(List employeeVOList, Employee emp) { + EmployeeVO employeeVO = Func.copy(emp, EmployeeVO.class); + setReturnCalculateValue(employeeVOList, emp, employeeVO); + } + + /** + * 计算值赋值 + */ + private void setReturnCalculateValue(List employeeVOList, Employee emp, EmployeeVO employeeVO) { + String date = Func.formatDate(new Date()).substring(0,4); + if(!Func.isNull(emp.getWorkBeginDate()) && Func.isNotBlank(emp.getWorkBeginDate())){ + //计算企业工龄 + employeeVO.setSeniorityInEnterprise(Integer.parseInt(date) - Integer.parseInt(emp.getWorkBeginDate().substring(0, 4))); + } + if(!Func.isNull(emp.getJobDate()) && Func.isNotBlank(emp.getJobDate())){ + //计算行业工龄 + employeeVO.setProfessionalLengthOfService(Integer.parseInt(date) - Integer.parseInt(emp.getJobDate().substring(0, 4))); + } + if(!Func.isNull(emp.getIdCard()) && Func.isNotBlank(emp.getIdCard()) && emp.getIdCard().trim().length()>=18){ + //计算年龄 + employeeVO.setAge(String.valueOf(Integer.parseInt(date) - Integer.parseInt(emp.getIdCard().trim().substring(6,10)))); + } + employeeVOList.add(employeeVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveEmployeeAndFamiliesAndJobRecords(EmployeeDTO employeeDTO) { + List deptList = Func.toStrList(employeeDTO.getDeptId()); + employeeDTO.setDeptId(deptList.get(deptList.size()-1)); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(Employee::getIdCard,employeeDTO.getIdCard()); + List employeeList = this.list(queryWrapper); + if (!employeeList.isEmpty()){ + return false; + } + //保存员工信息 + Employee employee = Func.copy(employeeDTO, Employee.class); + List families = Func.copy(employeeDTO.getFamilies(), Family.class); + List jobRecords = Func.copy(employeeDTO.getJobRecords(), JobRecord.class); + this.save(employee); + //保存员工家庭成员信息 + families.forEach(family -> { + assert employee != null; + family.setEmployeeId(employee.getId()); + }); + //保存员工履历信息 + jobRecords.forEach(jobRecord -> { + assert employee != null; + jobRecord.setEmployeeId(employee.getId()); + }); + //保存相关附件信息 + fileService.saveAttachments(employeeDTO.getRelevantAttachments(),employee.getId()); + return familyService.saveBatch(families) && jobRecordService.saveBatch(jobRecords); + } + + @Transactional(rollbackFor = Exception.class) + public void syncUserHistory(EmployeeDTO employeeDTO) { + log.info("员工【{}】要进行流水表借调同步",employeeDTO.getEmployeeNo()); + baseMapper.updateUserHistory(employeeDTO.getEmployeeNo(),employeeDTO.getIsSeconded()); + } + @Override + @Transactional(rollbackFor = Exception.class) + public boolean removeEmployeeAndFamiliesAndJobRecords(List ids) { + this.removeByIds(ids); + ids.forEach(employeeId -> { + String empId = String.valueOf(employeeId); + familyService.remove(new QueryWrapper().lambda().eq(Family::getEmployeeId, empId)); + jobRecordService.remove(new QueryWrapper().lambda().eq(JobRecord::getEmployeeId, empId)); + }); + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateEmployeeAndFamiliesAndJobRecords(EmployeeDTO employeeDTO) { + List deptList = Func.toStrList(employeeDTO.getDeptId()); + employeeDTO.setDeptId(deptList.get(deptList.size()-1)); + Employee employee = Func.copy(employeeDTO, Employee.class); + this.updateById(employee); + List families = Func.copy(employeeDTO.getFamilies(), Family.class); + families.forEach(family->{ + family.setEmployeeId(employee.getId()); + }); + List jobRecords = Func.copy(employeeDTO.getJobRecords(), JobRecord.class); + jobRecords.forEach(jobRecord -> { + jobRecord.setEmployeeId(employee.getId()); + }); + familyService.saveOrUpdateBatch(families); + jobRecordService.saveOrUpdateBatch(jobRecords); + //保存相关附件信息 + fileService.saveAttachments(employeeDTO.getRelevantAttachments(),employee.getId()); + //保存附件信息 + fileService.saveAttachments(employeeDTO.getIdCardFrontList(),employee.getId()); + //保存附件信息 + fileService.saveAttachments(employeeDTO.getIdCardBackList(),employee.getId()); + //保存附件信息 + fileService.saveAttachments(employeeDTO.getPicList(),employee.getId()); + //与t_user_sync_history表同步对应员工的借调标志。如果员工属于借调状态,该员工后续信息不进行总线同步;如果从借调改为非借调,则后续会从消息总线进行信息同步 + syncUserHistory(employeeDTO); + return true; + } + + @Override + public EmployeeVO getEmployeeAndFamiliesAndJobRecords(String id) { + Employee employee = this.getById(id); + List familyList = familyService.list(new QueryWrapper().lambda() + .eq(Family::getEmployeeId, id)); + List jobRecordList = jobRecordService.list(new QueryWrapper().lambda() + .eq(JobRecord::getEmployeeId, id)); + + EmployeeVO employeeVO = Func.copy(employee, EmployeeVO.class); + assert employeeVO != null; + Department department = departmentService.getById(employee.getDeptId()); + if(Func.isNotEmpty(department)){ + String ancestors = department.getAncestors(); + List deptList = Func.toStrList(ancestors); + List list = deptList.stream().filter(item -> !item.equals(deptList.get(0))).collect(Collectors.toList()); + // 数据库存储的Ancestors顺序是祖辈级别越高越靠后,需要先进行逆序 + Collections.reverse(list); + list.add(employee.getDeptId()); + employeeVO.setDeptList(list); + employeeVO.setDepartment(department.getDeptName()); + } +// 员工借调前原部门的查询赋值 + if(Func.isNotEmpty(employee.getSecondDeptId())){ + Department departmentSecond = departmentService.getById(employee.getSecondDeptId()); + if(Func.isNotEmpty(departmentSecond)){ + String ancestors2 = departmentSecond.getAncestors(); + List deptList2 = Func.toStrList(ancestors2); + List list2 = deptList2.stream().filter(item -> !item.equals(deptList2.get(0))).collect(Collectors.toList()); + Collections.reverse(list2); + list2.add(employee.getSecondDeptId()); + employeeVO.setSecondDeptList(list2); + employeeVO.setSecondDepartment(departmentSecond.getDeptName()); + } + } + + //获取相关附件 + List attachments = fileService.getAttachments(id,employee.getGroupName()); + //获取相关附件证件照 + List attachmentsHead = fileService.getAttachments(id,employee.getGroupNameHead()); + //获取相关附件身份证正面 + List attachmentsFront = fileService.getAttachments(id,employee.getGroupNameFront()); + //获取相关附件身份证反面 + List attachmentsBack = fileService.getAttachments(id,employee.getGroupNameBack()); + + employeeVO.setFamilies(familyList); + employeeVO.setJobRecords(jobRecordList); + employeeVO.setRelevantAttachments(attachments); + employeeVO.setPicList(attachmentsHead); + employeeVO.setIdCardFrontList(attachmentsFront); + employeeVO.setIdCardBackList(attachmentsBack); + return employeeVO; + } + + @Override + public EmployeeVO getLeaderByDeptId() { + String deptId = AuthUtil.getDeptId(); + //获取登录账号机构以及上级机构所有领导 + Department department = departmentService.getById(deptId); + String ancestors = department.getAncestors(); + List deptList = Func.toStrList(ancestors); + List deptIds = deptList.stream().filter(item -> !item.equals(deptList.get(0))).collect(Collectors.toList()); + deptIds.add(deptId); + List allLeaders = this.list(new QueryWrapper().lambda() + .in(Employee::getDeptId, deptIds) + .in(Employee::getCivilAirDefenseType, LEADER, LEADER_IN_CHARGE)); + List> leaderInChargeList = new ArrayList<>(); + allLeaders.forEach(leader -> { + Map map = new HashMap<>(); + map.put("key", leader.getId()); + map.put("value", leader.getName()); + leaderInChargeList.add(map); + }); + //获取登录账号机构负责人 + List Leaders = this.list(new QueryWrapper().lambda() + .eq(Employee::getDeptId, deptId) + .eq(Employee::getCivilAirDefenseType, LEADER)); + List> leaderList = new ArrayList<>(); + Leaders.forEach(leader -> { + Map map = new HashMap<>(); + map.put("key", leader.getId()); + map.put("value", leader.getName()); + leaderList.add(map); + }); + //获取登录账号机构安全员 + List SafetyOfficers = this.list(new QueryWrapper().lambda() + .eq(Employee::getDeptId, deptId) + .eq(Employee::getCivilAirDefenseType, SAFER)); + List> safetyOfficerList = new ArrayList<>(); + SafetyOfficers.forEach(safer -> { + Map map = new HashMap<>(); + map.put("key", safer.getId()); + map.put("value", safer.getName()); + safetyOfficerList.add(map); + }); + EmployeeVO employeeVO = new EmployeeVO(); + employeeVO.setLeaderInChargeList(leaderInChargeList); + employeeVO.setLeaderList(leaderList); + employeeVO.setSafetyOfficerList(safetyOfficerList); + return employeeVO; + } + + @Override + public boolean synEmployeeData(List employees) { + return this.saveOrUpdateBatch(employees); + } + + @Override + public List getEmployeeStatisticsData(EmployeeDTO employeeDTO) { + List aimDepts = inspectionDataService.setDeptIds(employeeDTO.getDeptId(), employeeDTO.getIncludeChildren()); + List collect = this.list(new QueryWrapper().lambda() + .eq( Employee::getDelFlag, "0") + .in(Func.isNotEmpty(aimDepts), Employee::getDeptId, aimDepts)); + List employeeVOList = new ArrayList<>(); + collect.forEach(emp -> setDataVO2(employeeVOList, emp)); + return employeeVOList; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/FamilyServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/FamilyServiceImpl.java new file mode 100644 index 0000000..12665de --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/FamilyServiceImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service.impl; + +import org.security.ht.entity.basic.Family; +import org.security.ht.vo.basic.FamilyVO; +import org.security.trans.basic.mapper.FamilyMapper; +import org.security.trans.basic.service.IFamilyService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 基础信息-员工家庭成员 服务实现类 + * + * @author BladeX + * @since 2022-03-08 + */ +@Service +public class FamilyServiceImpl extends ServiceImpl implements IFamilyService { + + @Override + public IPage selectFamilyPage(IPage page, FamilyVO family) { + return page.setRecords(baseMapper.selectFamilyPage(page, family)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/JobRecordServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/JobRecordServiceImpl.java new file mode 100644 index 0000000..47b8672 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/JobRecordServiceImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service.impl; + +import org.security.ht.entity.basic.JobRecord; +import org.security.ht.vo.basic.JobRecordVO; +import org.security.trans.basic.mapper.JobRecordMapper; +import org.security.trans.basic.service.IJobRecordService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 基础信息-员工工作履历 服务实现类 + * + * @author BladeX + * @since 2022-03-08 + */ +@Service +public class JobRecordServiceImpl extends ServiceImpl implements IJobRecordService { + + @Override + public IPage selectJobRecordPage(IPage page, JobRecordVO jobRecord) { + return page.setRecords(baseMapper.selectJobRecordPage(page, jobRecord)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/LawServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/LawServiceImpl.java new file mode 100644 index 0000000..773fd14 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/LawServiceImpl.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.AllArgsConstructor; +import org.apache.commons.lang.StringUtils; +import org.security.common.Constant; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.basic.dto.LawDTO; +import org.security.ht.entity.basic.Department; +import org.security.ht.entity.basic.Law; +import org.security.trans.basic.service.IDepartmentService; +import org.security.ht.vo.basic.LawVO; +import org.security.trans.basic.mapper.LawMapper; +import org.security.trans.basic.service.ILawService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.common.service.IFileService; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.math.BigDecimal; +import java.util.List; + +import static org.security.common.Constant.DELETE_FLAG_0; + +/** + * 服务实现类 + * + * @author BladeX + * @since 2022-05-30 + */ +@Service +@AllArgsConstructor +public class LawServiceImpl extends ServiceImpl implements ILawService { + @Autowired + private IDepartmentService departmentService; + private final IFileService fileService; + + @Override + public IPage selectLawPage(IPage page, LawDTO lawDTO) { + String deptId = null; + if (StringUtils.isNotBlank(lawDTO.getDeptId())) { + List deptIds = Func.toLongList(lawDTO.getDeptId()); + deptId = String.valueOf(deptIds.get(deptIds.size() - 1)); + } + Page lawPage = new Page<>(page.getCurrent(), page.getSize()); + LambdaQueryWrapper lawQueryWrapper = setQueryWrappers(lawDTO, deptId); + IPage resultPage = this.baseMapper.selectLawPage(lawPage, lawQueryWrapper); + return resultPage; + } + + /** + *构造查询条件 + */ + private LambdaQueryWrapper setQueryWrappers(LawDTO lawDTO, String deptId) { + return new QueryWrapper().lambda() + .eq(Law::getDelFlag,DELETE_FLAG_0) + .eq(StringUtils.isNotBlank(deptId), Law::getDeptId, deptId) + .like(StringUtils.isNotBlank(lawDTO.getName()), Law::getName, lawDTO.getName()) + .eq(Func.isNoneBlank(lawDTO.getType()),Law:: getType, lawDTO.getType()) + .eq(Func.isNoneBlank(lawDTO.getLawType()),Law:: getLawType, lawDTO.getLawType()) + .orderByDesc(Law::getCreatedTime); + } + + @Override + public LawVO getLawById(BigDecimal id) { + Law law = this.getById(id); + Department department = departmentService.getById(law.getDeptId()); + LawVO lawVO = Func.copy(law, LawVO.class); + assert lawVO != null; + lawVO.setDeptName(department.getDeptName()); + //获取相关法律法规附件 + List fileList = fileService.getAttachments(String.valueOf(id),law.getGroupName()); + lawVO.setFileList(fileList); + return lawVO; + } + + @Override + public R saveLaw(LawDTO lawDTO){ + lawDTO.setState(Constant.FORM_STATE_DRAFT); + super.saveOrUpdate(lawDTO); + //保存相关附件信息 + fileService.saveAttachments(lawDTO.getFileList(),lawDTO.getId()); + return R.success("操作成功!"); + } + + @Override + public R submit(LawDTO lawDTO){ + lawDTO.setState(Constant.FORM_STATE_VALID); + lawDTO.setOpenTime(DateUtil.now()); + super.saveOrUpdate(lawDTO); + //保存相关附件信息 + fileService.saveAttachments(lawDTO.getFileList(),lawDTO.getId()); + return R.success("操作成功!"); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/MailListServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/MailListServiceImpl.java new file mode 100644 index 0000000..ce8bf2d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/MailListServiceImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service.impl; + +import org.security.ht.entity.basic.MailList; +import org.security.ht.vo.basic.MailListVO; +import org.security.trans.basic.mapper.MailListMapper; +import org.security.trans.basic.service.IMailListService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 基础信息-联系信息表 服务实现类 + * + * @author BladeX + * @since 2022-05-18 + */ +@Service +public class MailListServiceImpl extends ServiceImpl implements IMailListService { + + @Override + public IPage selectMailListPage(IPage page, MailListVO mailList) { + return page.setRecords(baseMapper.selectMailListPage(page, mailList)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/SelfHelpBankServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/SelfHelpBankServiceImpl.java new file mode 100644 index 0000000..7d035b4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/basic/service/impl/SelfHelpBankServiceImpl.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.basic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.security.trans.basic.dto.SelfHelpBankDTO; +import org.security.ht.entity.basic.Department; +import org.security.ht.entity.basic.SelfHelpBank; +import org.security.trans.basic.service.IDepartmentService; +import org.security.ht.vo.basic.SelfHelpBankVO; +import org.security.trans.basic.mapper.SelfHelpBankMapper; +import org.security.trans.basic.service.ISelfHelpBankService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.ArrayList; +import java.util.List; + +/** + * 基础信息-自助银行 服务实现类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Service +public class SelfHelpBankServiceImpl extends ServiceImpl implements ISelfHelpBankService { + @Autowired + private IDepartmentService departmentService; + + @Override + public IPage selectSelfHelpBankPage(IPage page, SelfHelpBankDTO selfHelpBankDTO) { + Page selfHelpBankPage = new Page<>(page.getCurrent(), page.getSize()); + SelfHelpBank selfHelpBank = Func.copy(selfHelpBankDTO, SelfHelpBank.class); + QueryWrapper queryWrapper = Condition.getQueryWrapper(selfHelpBank); + Page resultPage = this.page(selfHelpBankPage, queryWrapper); + List records = resultPage.getRecords(); + List selfHelpBankVOList = new ArrayList<>(); + records.forEach(item -> { + SelfHelpBankVO selfHelpBankVO = Func.copy(item, SelfHelpBankVO.class); + selfHelpBankVOList.add(selfHelpBankVO); + }); + return new Page() + .setCurrent(resultPage.getCurrent()) + .setSize(resultPage.getSize()) + .setTotal(resultPage.getTotal()) + .setRecords(selfHelpBankVOList); + } + + @Override + public SelfHelpBankVO getSelfHelpBankById(Long id) { + SelfHelpBank selfHelpBank = this.getById(id); + Department department = departmentService.getById(selfHelpBank.getDeptId()); + SelfHelpBankVO selfHelpBankVO = Func.copy(selfHelpBank, SelfHelpBankVO.class); + assert selfHelpBankVO != null; + selfHelpBankVO.setDeptName(department.getDeptName()); + return selfHelpBankVO; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/controller/ExcelExportController.java b/security-service/ht-security/src/main/java/org/security/trans/common/controller/ExcelExportController.java new file mode 100644 index 0000000..7cb98d3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/controller/ExcelExportController.java @@ -0,0 +1,35 @@ +package org.security.trans.common.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.common.dto.ExcelExportDTO; +import org.security.trans.common.service.ExcelExportService; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.InvocationTargetException; + +/** + * @author nantian.yangzhengyu + * @date 2023/11/8 10:36 + */ +@Api(value = "公共-excel导出", tags = "公共-excel导出接口") +@RestController +@AllArgsConstructor +@RequestMapping("/excelExport") +public class ExcelExportController { + private ExcelExportService excelExportService; + /** + * 导出excel表公共接口 + */ + @PostMapping("/exportData") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导出excel表公共接口", notes = "传入ids") + public void exportData(HttpServletResponse httpServletResponse, @RequestBody ExcelExportDTO excelExportDTO) throws ClassNotFoundException,NoSuchMethodException,InstantiationException, + IllegalAccessException, InvocationTargetException { + excelExportService.exportData(httpServletResponse, excelExportDTO); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/controller/FileController.java b/security-service/ht-security/src/main/java/org/security/trans/common/controller/FileController.java new file mode 100644 index 0000000..4ac6be8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/controller/FileController.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.common.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.apache.commons.lang.StringUtils; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.FileVO; +import org.security.ht.vo.common.UploadVO; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; +import java.util.Objects; + +/** + * 公共-附件表 控制器 + * + * @author BladeX + * @since 2022-07-04 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/file") +@Api(value = "公共-附件表", tags = "公共-附件表接口") +public class FileController extends BladeController { + + private final IFileService fileService; + + + /** + * 附件显示列表处删除附件 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(fileService.removeFileData2(Func.toStrList(ids))); + } + + @PostMapping("/update") + public R update(@RequestParam MultipartFile file, + @RequestParam String id) throws IOException { + if (Objects.isNull(file) || file.isEmpty()) { + return R.fail("文件不能为空"); + } + if (StringUtils.isBlank(id)) { + return R.fail("附件ID不能为空"); + } + return R.status(fileService.update(file, id)); + } + + @GetMapping("/list") + @ApiOperation(value = "附件list", notes = "传入linkId") + public R> list(@RequestParam String linkId,@RequestParam String groupName) { + List attachments = fileService.getAttachments(linkId,groupName); + return R.data(attachments); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/controller/Oauth2Controller.java b/security-service/ht-security/src/main/java/org/security/trans/common/controller/Oauth2Controller.java new file mode 100644 index 0000000..21b4765 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/controller/Oauth2Controller.java @@ -0,0 +1,36 @@ +package org.security.trans.common.controller; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.trans.common.service.Oauth2Service; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +import javax.servlet.http.HttpServletRequest; + +/** + * @author zj 2022/6/27 + */ +@Slf4j +@AllArgsConstructor +@Controller +public class Oauth2Controller { + + private final Oauth2Service oauth2Service; + + /** + * app单点登录 + */ + @GetMapping("/app/oauth") + public String assOauth(HttpServletRequest request) { + return oauth2Service.appOauth(request); + } + + /** + * pc端单点登录 + */ + @GetMapping("/pc/oauth") + public String pcOauth() { + return null; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/controller/UploadController.java b/security-service/ht-security/src/main/java/org/security/trans/common/controller/UploadController.java new file mode 100644 index 0000000..cecc7b9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/controller/UploadController.java @@ -0,0 +1,60 @@ +package org.security.trans.common.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.common.service.UploadService; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +/** + * @author zj 2022/4/29 + */ +@AllArgsConstructor +@Api(value = "上传", tags = "上传") +@RestController +@RequestMapping("/upload") +public class UploadController { + + private final UploadService uploadService; + + @ApiOperationSupport(order = 0) + @ApiOperation(value = "单个文件上传", notes = "单个文件上传") + @ApiImplicitParams({ + @ApiImplicitParam(name = "file", value = "FormData", dataType = "FormData"), + }) + @PostMapping("/single") + public R upload(@RequestParam MultipartFile file, + @RequestParam(required = false) String groupType, + @RequestParam(required = false) String groupName) throws IOException { + if (file.isEmpty()) { + return R.fail("文件不能为空"); + } + return R.data(uploadService.uploadSingleFile(file, groupType, groupName)); + } + + @ApiOperationSupport(order = 1) + @ApiOperation(value = "批量文件上传", notes = "批量文件上传") + @ApiImplicitParams({ + @ApiImplicitParam(name = "files", value = "FormData", dataType = "FormData"), + }) + @PostMapping("/list") + public R uploadList(@RequestParam List files, + @RequestParam(required = false) String groupType, + @RequestParam(required = false) String groupName) throws IOException { + if (files.isEmpty()) { + return R.fail("文件列表不能为空"); + } + return R.data(uploadService.uploadListFile(files, groupType, groupName)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/dto/AccessTokenDTO.java b/security-service/ht-security/src/main/java/org/security/trans/common/dto/AccessTokenDTO.java new file mode 100644 index 0000000..5fa36d0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/dto/AccessTokenDTO.java @@ -0,0 +1,13 @@ +package org.security.trans.common.dto; + +import lombok.Data; + +/** + * @author zj 2022/6/28 + */ +@Data +public class AccessTokenDTO { + private String accessToken; + private Long expireIn; + private String refreshToken; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/dto/AuthResult.java b/security-service/ht-security/src/main/java/org/security/trans/common/dto/AuthResult.java new file mode 100644 index 0000000..7751327 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/dto/AuthResult.java @@ -0,0 +1,14 @@ +package org.security.trans.common.dto; + +import lombok.Data; + +/** + * @author zj 2022/6/27 + */ +@Data +public class AuthResult { + private String errorCode; + private T data; + private String success; + private String error; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/dto/BaseObject.java b/security-service/ht-security/src/main/java/org/security/trans/common/dto/BaseObject.java new file mode 100644 index 0000000..6000554 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/dto/BaseObject.java @@ -0,0 +1,33 @@ +package org.security.trans.common.dto; + +import java.io.Serializable; +import java.util.HashMap; + +/** + * @author nantian.yangzhengyu + * @date 2023/11/14 17:04 + */ +public class BaseObject implements Serializable { + private String tableName; + private HashMap colsValue = new HashMap<>(); + public HashMap GetColsValue(){ + return this.colsValue; + } + public String getTableName(){ + return this.tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public Object getColsValue(Object keyId) { + if(colsValue.containsKey(keyId)) + return colsValue.get(keyId); + return null; + } + + public void setColsValue(Object keyId,Object keyValue) { + this.colsValue.put(keyId,keyValue); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/dto/ExcelExportDTO.java b/security-service/ht-security/src/main/java/org/security/trans/common/dto/ExcelExportDTO.java new file mode 100644 index 0000000..f7daa04 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/dto/ExcelExportDTO.java @@ -0,0 +1,24 @@ +package org.security.trans.common.dto; + +import lombok.Builder; +import lombok.Data; +import org.apache.poi.ss.formula.functions.T; + +import java.util.List; + +/** + * @author nantian.yangzhengyu + * @date 2023/11/8 10:38 + */ +@Data +@Builder +public class ExcelExportDTO { +// 实体 + private String entityName; +// 实体对应service类名 + private String serviceName; +// 需要导出的字段列表 + private List fieldLists; + // 需要导出的记录id列表 + private List ids; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/dto/ExcelExportFieldDTO.java b/security-service/ht-security/src/main/java/org/security/trans/common/dto/ExcelExportFieldDTO.java new file mode 100644 index 0000000..ec065ea --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/dto/ExcelExportFieldDTO.java @@ -0,0 +1,36 @@ +package org.security.trans.common.dto; + +import lombok.Builder; +import lombok.Data; + +/** + * @author nantian.yangzhengyu + * @date 2023/11/8 10:42 + */ +@Data +@Builder +public class ExcelExportFieldDTO { + /** + * 字段名称 + */ + private String fieldName; + /** + * 字段名称-中文 + */ + private String fieldNameCN; + /** + * 字段取值类型 + * normal-普通字段,直接取数据库的值 + * dic-转码字段,需要根据数据库值到相应字典表取相应的中文值 + * foreign-外键字段,需要到关联表中查询该外键对应的记录的名称 + */ + private String fieldType; + /** + * 针对外键字段,需要到关联的实体名 + */ + private String fEntityName; + /** + * 针对外键字段,需要到关联的实体对应的字段名,通常就是name,但偶有特例,比如部门是deptName + */ + private String fFieldName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/dto/FileDTO.java b/security-service/ht-security/src/main/java/org/security/trans/common/dto/FileDTO.java new file mode 100644 index 0000000..e402874 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/dto/FileDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.common.dto; + +import org.security.ht.entity.common.File; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 公共-附件表数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-04 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class FileDTO extends File { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/dto/UserDetailDTO.java b/security-service/ht-security/src/main/java/org/security/trans/common/dto/UserDetailDTO.java new file mode 100644 index 0000000..1139fa5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/dto/UserDetailDTO.java @@ -0,0 +1,23 @@ +package org.security.trans.common.dto; + +import lombok.Data; + +/** + * @author zj 2022/6/27 + */ +@Data +public class UserDetailDTO { + private String appid; + private String xtid; + private String oid; + private String eid; + private String username; + private String userid; + private String uid; + private String tid; + private String jobNo; + private String networkid; + private String deviceId; + private String openid; + private String ticket; + } diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/mapper/ExcelExportMapper.java b/security-service/ht-security/src/main/java/org/security/trans/common/mapper/ExcelExportMapper.java new file mode 100644 index 0000000..3099feb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/mapper/ExcelExportMapper.java @@ -0,0 +1,18 @@ +package org.security.trans.common.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.security.trans.common.dto.BaseObject; + +import java.util.HashMap; +import java.util.List; + +/** + * @author nantian.yangzhengyu + * @date 2023/11/14 17:01 + */ +@Mapper +public interface ExcelExportMapper extends BaseMapper { + List> querySelectByIds(@Param("tableName") String tableName,@Param("idList") List idList); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/mapper/ExcelExportMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/common/mapper/ExcelExportMapper.xml new file mode 100644 index 0000000..281447d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/mapper/ExcelExportMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/mapper/FileMapper.java b/security-service/ht-security/src/main/java/org/security/trans/common/mapper/FileMapper.java new file mode 100644 index 0000000..e9c8602 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/mapper/FileMapper.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.common.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.ht.entity.common.File; +import org.security.ht.vo.common.FileVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 公共-附件表 Mapper 接口 + * + * @author BladeX + * @since 2022-07-04 + */ +public interface FileMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param file + * @return + */ + List selectFilePage(IPage page, FileVO file); + /** + * 获取单个用户名称 + * @param userId 用户id + * @return + */ + String getUserName(@Param("userId") String userId); + /** + *数据统计获取子级机构id + */ + List getChildrenDeptId(@Param("aimDeptId") String aimDeptId); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/mapper/FileMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/common/mapper/FileMapper.xml new file mode 100644 index 0000000..e845b1e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/mapper/FileMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/ExcelExportService.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/ExcelExportService.java new file mode 100644 index 0000000..960e6ef --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/ExcelExportService.java @@ -0,0 +1,21 @@ +package org.security.trans.common.service; + +import org.security.trans.common.dto.ExcelExportDTO; + +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.InvocationTargetException; + +/** + * @author nantian.yangzhengyu + * @date 2023/11/8 11:21 + */ +public interface ExcelExportService { + /** + * 根据参数导出对应excel + * + * @param httpServletResponse + * @param excelExportDTO 参数(实体名、需导出字段、记录对应ids) + */ + void exportData(HttpServletResponse httpServletResponse, ExcelExportDTO excelExportDTO) + throws ClassNotFoundException,NoSuchMethodException,InstantiationException,IllegalAccessException, InvocationTargetException; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/FlowableService.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/FlowableService.java new file mode 100644 index 0000000..e7a9b33 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/FlowableService.java @@ -0,0 +1,111 @@ +package org.security.trans.common.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import org.apache.commons.lang.StringUtils; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.feign.IFlowClient; +import org.security.ht.entity.common.FlowEntity; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public interface FlowableService extends IService { + /** + * 删除流程(保留流程历史等信息) + * + * @param processInstanceId 流程id + * @throws ServiceException 根据流程id没有查询到流程实例 + */ + default Boolean deleteProcessInstanceOnly(String processInstanceId) { + return false; + } + + /** + * 删除实体及流程(包括历史记录等信息) + * + * @param ids 实体id列表 + * @throws ServiceException 根据流程id没有查询到流程实例 + */ + @Transactional + default Boolean deleteWithFlowByIds(String ids, IFlowClient flowClient) { + List idList = Func.toLongList(ids); + if (CollectionUtils.isEmpty(idList)) { + return false; + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper + .setEntityClass((Class) getEntityClass()) + .select(T::getProcessInstanceId) + .in(T::getId, idList); + List list = this.list(wrapper); + List instanceIds = list.stream().map(T::getProcessInstanceId).collect(Collectors.toList()); + boolean deleteEntityResult = SqlHelper.retBool(getBaseMapper().deleteBatchIds(idList)); + if (!deleteEntityResult) { + return false; + } + R deleteFlowResult = flowClient.deleteProcessInstanceByInstanceId(StringUtils.join(instanceIds, ",")); + if (!deleteFlowResult.isSuccess()) { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return false; + } + return true; + } + + /** + * 只删除流程(包括历史记录等信息) + * + * @param ids 实体id列表 + * @throws ServiceException 根据流程id没有查询到流程实例 + */ + @Transactional + default Boolean deleteFlowOnly(String ids, IFlowClient flowClient) { + List idList = Func.toLongList(ids); + if (CollectionUtils.isEmpty(idList)) { + return false; + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper + .setEntityClass((Class) getEntityClass()) + .select(T::getProcessInstanceId) + .in(T::getId, idList); + List list = this.list(wrapper); + List instanceIds = list.stream().map(T::getProcessInstanceId).collect(Collectors.toList()); + R deleteFlowResult = flowClient.deleteProcessInstanceByInstanceId(StringUtils.join(instanceIds, ",")); + if (!deleteFlowResult.isSuccess()) { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return false; + } + return true; + } + + default Boolean updateStateById(String id, String state) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper + .setEntityClass((Class) getEntityClass()) + .eq(T::getId, id) + .set(T::getState, state); + return this.update(wrapper); + } + + default R afterFlowFinished(String id, Boolean pass, Map variables) { + String state; + if (null == pass) { + state = ProcessConstant.CANCEL_STATE; + } else if (pass) { + state = ProcessConstant.PASS_STATE; + } else { + state = ProcessConstant.REJECT_STATE; + } + return R.status(this.updateStateById(id, state)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/IFileService.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/IFileService.java new file mode 100644 index 0000000..cbe2619 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/IFileService.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.common.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.ht.entity.common.File; +import org.security.ht.vo.common.FileVO; +import org.security.ht.vo.common.UploadVO; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +/** + * 公共-附件表 服务类 + * + * @author BladeX + * @since 2022-07-04 + */ +public interface IFileService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param file + * @return + */ + IPage selectFilePage(IPage page, FileVO file); + + /** + * 保存相关附件 + * @param relevantAttachments 附件列表 + * @param aimId 附件关联记录的主对象的id + */ + void saveAttachments(List relevantAttachments,String aimId); + + + /** + * 获取相关附件 + * @param id 附件关联记录的主对象的id + * @return + */ + List getAttachments(String id,String groupName); + + /** + * 删除相关附件 + * @param detailIdList 业务数据id集合 + * @return + */ + boolean removeFileData(List detailIdList); + + /** + * 删除相关附件 + * @param detailIdList 附件id集合 + * @return + */ + boolean removeFileData2(List detailIdList); + + boolean update(MultipartFile file, String id) throws IOException; + /** + * 根据用户id查询用户姓名 单个用户 + * @param userId + * @return + */ + String getUserNameById(String userId); + /** + * 根据用户id查询用户姓名 多个用户 + * @param userIds + * @return + */ + String getUserNameByIds(List userIds); + /** + * 根据部门id和是否包含子级,查询部门id列表 + * @param aimDeptId + * @param includeChildren + * @return + */ + List setDeptIds(String aimDeptId,String includeChildren); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/Oauth2Service.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/Oauth2Service.java new file mode 100644 index 0000000..99b2e5d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/Oauth2Service.java @@ -0,0 +1,13 @@ +package org.security.trans.common.service; + +import javax.servlet.http.HttpServletRequest; + +/** + * @author zj 2022/7/4 + */ +public interface Oauth2Service { + + String appOauth(HttpServletRequest request); + + String pcOauth(); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/UploadService.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/UploadService.java new file mode 100644 index 0000000..ae7e935 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/UploadService.java @@ -0,0 +1,29 @@ +package org.security.trans.common.service; + +import org.security.ht.vo.common.UploadVO; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.List; + +/** + * @author zj 2022/5/11 + */ +public interface UploadService { + + /** + * 单个文件上传 + * + * @param file + * @return + */ + UploadVO uploadSingleFile(MultipartFile file, String groupType, String groupName) throws IOException; + + /** + * 批量文件上传 + * + * @param files + * @return + */ + List uploadListFile(List files, String groupType, String groupName); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/ExcelExportServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/ExcelExportServiceImpl.java new file mode 100644 index 0000000..d553892 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/ExcelExportServiceImpl.java @@ -0,0 +1,262 @@ +package org.security.trans.common.service.impl; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.support.ExcelTypeEnum; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.security.common.handler.CustomCellWriteHandler; +import org.security.trans.common.dto.BaseObject; +import org.security.trans.common.dto.ExcelExportDTO; +import org.security.trans.common.dto.ExcelExportFieldDTO; +import org.security.trans.common.mapper.ExcelExportMapper; +import org.security.trans.common.service.ExcelExportService; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.math.BigDecimal; +import java.util.*; + +import static org.security.common.util.MyCellStyleStrategyUtil.getHorizontalCellStyleStrategy; + +/** + * @author nantian.yangzhengyu + * @date 2023/11/8 11:22 + */ +@Slf4j +@AllArgsConstructor +@Service +public class ExcelExportServiceImpl extends ServiceImpl implements ExcelExportService { + @Override + public void exportData(HttpServletResponse httpServletResponse, ExcelExportDTO excelExportDTO) throws ClassNotFoundException, NoSuchMethodException, + InstantiationException, IllegalAccessException, InvocationTargetException { + log.info("---------------com导出开始,excelExportDTO:[{}]-----------", excelExportDTO); + List idList = excelExportDTO.getIds(); + List fieldList = excelExportDTO.getFieldLists(); + if (Func.isEmpty(excelExportDTO.getEntityName())) { + throw new ServiceException("获取实体名失败,请稍后再试!"); + } + if (Func.isEmpty(excelExportDTO.getServiceName())) { + throw new ServiceException("获取服务名失败,请稍后再试!"); + } + if (Func.isEmpty(fieldList)) { + throw new ServiceException("导出字段不能为空!"); + } + if (Func.isEmpty(idList)) { + throw new ServiceException("导出记录不能为空!"); + } + //根据EntityName获取对应entity + Class clEntity = Class.forName(excelExportDTO.getEntityName()); + Object entityObj = clEntity.newInstance(); + TableName table = entityObj.getClass().getAnnotation(TableName.class); +// 声明查询出的数据list HashMap类型,需要转换成对应的实体类 + List> hashMapList = this.querySelect(table.value(), idList); +// 声明需要导出的数据list + List dataList = new ArrayList<>(); + if (Func.isNotEmpty(hashMapList) && hashMapList.size() > 0) { + hashMapList.forEach(item -> { +// 将每条HashMap类型的数据,转换成对应的实体类对象,并添加到dataList + Object itemObj = JSON.parseObject(JSON.toJSONString(item), entityObj.getClass()); + dataList.add(itemObj); + }); + } + if (dataList.size() > 0) { + log.info("======datalist:【{}】========", dataList); + log.info("======fieldList:【{}】========", fieldList); + } + + } + + public void file(List dataList, List fieldList){ + //组excel文件 + if (Func.isNotEmpty(dataList)) { + log.info("待导出数据:[{}]", dataList); +// List vos = new ArrayList<>(); + dataList.forEach(item -> { + fieldList.forEach(f->{ + Object theValue = this.getValue(item,f); + if(Func.isNotEmpty(theValue)){ + log.info("======item.getvalue :【{}】========", theValue); + } + }); +// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +// ExportRecordsVO vo = Func.copy(item, ExportRecordsVO.class); +// vo.setStartTime(format.format(item.getStartTime())); +// vo.setEndTime(format.format(item.getEndTime())); +// vo.setType("1".equals(vo.getType()) ? "工作日" : "非工作日"); +// vo.setPersonInCharge(employeeService.getById(item.getPersonInCharge()).getName()); +// List lines = dutyRecordsLinesService.list(new QueryWrapper().lambda().eq(DutyRecordsLines::getFormId, item.getId())); +// List personnelOnDuties = new ArrayList<>(); +// if (Func.isNotEmpty(lines)) { +// lines.forEach(line -> { +// line.setPerson(employeeService.getById(line.getPerson()).getName()); +// personnelOnDuties.add(line.getPerson().concat("-").concat(line.getPhone())); +// }); +// } +// vo.setPersonnelOnDuties(Func.join(personnelOnDuties).replace(",", "\n")); +// vos.add(vo); +// }); +// //导出excel +// ExcelUtil.export(httpServletResponse, "值班备勤表", "sheet1", vos, ExportRecordsVO.class); + }); + } + } + + public List> querySelect(String tableName, List idList) { + log.info("---------------this.baseMapper:[{}]", this.baseMapper); + return this.baseMapper.querySelectByIds(tableName, idList); + } + /** + * 根据属性名,获取该属性的get方法 + */ + public Object getGetMethod(Object obj,String nameStr) throws Exception{ + Method[] m = obj.getClass().getMethods(); + for(int i=0;i typeClass,Object value){ + filedName = removeLine(filedName); + String methodName = "set" + filedName.substring(0,1).toUpperCase()+filedName.substring(1); + try{ + Method method = obj.getClass().getDeclaredMethod(methodName, new Class[]{typeClass}); + method.invoke(obj, new Object[]{getClassTypeValue(typeClass, value)}); + }catch(Exception ex){ + ex.printStackTrace(); + } + } + + /** + * 通过class类型获取获取对应类型的值 + * @param typeClass class类型 + * @param value 值 + * @return Object + */ + private static Object getClassTypeValue(Class typeClass, Object value){ + if(typeClass == int.class || value instanceof Integer){ + if(null == value){ + return 0; + } + return value; + }else if(typeClass == short.class){ + if(null == value){ + return 0; + } + return value; + }else if(typeClass == byte.class){ + if(null == value){ + return 0; + } + return value; + }else if(typeClass == double.class){ + if(null == value){ + return 0; + } + return value; + }else if(typeClass == long.class){ + if(null == value){ + return 0; + } + return value; + }else if(typeClass == String.class){ + if(null == value){ + return ""; + } + return value; + }else if(typeClass == boolean.class){ + if(null == value){ + return true; + } + return value; + }else if(typeClass == BigDecimal.class){ + if(null == value){ + return new BigDecimal(0); + } + return new BigDecimal(value+""); + }else { + return typeClass.cast(value); + } + } + + /** + * 处理字符串 如: abc_dex ---> abcDex + * @param str + * @return + */ + public static String removeLine(String str){ + if(null != str && str.contains("_")){ + int i = str.indexOf("_"); + char ch = str.charAt(i+1); + char newCh = (ch+"").substring(0, 1).toUpperCase().toCharArray()[0]; + String newStr = str.replace(str.charAt(i+1), newCh); + String newStr2 = newStr.replace("_", ""); + return newStr2; + } + return str; + } + + /** * 生成excel + * @param excelName excel名称 + * @param sheetName excel sheet名称 + * @param bodyList excel 主数据 + * @param headList excel 头标题 + */ + public void generateExcel(String excelName, String sheetName, List> bodyList, List> headList) { + HorizontalCellStyleStrategy horizontalCellStyleStrategy = getHorizontalCellStyleStrategy(); + CustomCellWriteHandler handler = new CustomCellWriteHandler(); //指定单元格样式 //用来记录需要为第`key`行中的第`value.get(i)`列设置样式 + HashMap> map = new HashMap<>(); + CustomCellWriteHandler writeHandler = new CustomCellWriteHandler(map, IndexedColors.RED.getIndex()); + EasyExcel.write(excelName + ".xlsx") + .excelType(ExcelTypeEnum.XLSX) + .sheet() + .sheetName(sheetName) + .head(headList) + .automaticMergeHead(true) + .registerWriteHandler(horizontalCellStyleStrategy) + .registerWriteHandler(writeHandler) + .registerWriteHandler(handler) + .doWrite(bodyList); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/ExcelExportServiceImplTest.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/ExcelExportServiceImplTest.java new file mode 100644 index 0000000..644c46a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/ExcelExportServiceImplTest.java @@ -0,0 +1,79 @@ +package org.security.trans.common.service.impl; + +//import org.jboss.arquillian.container.test.api.Deployment; +//import org.jboss.arquillian.junit.Arquillian; +//import org.jboss.shrinkwrap.api.ShrinkWrap; +//import org.jboss.shrinkwrap.api.asset.EmptyAsset; +//import org.jboss.shrinkwrap.api.spec.JavaArchive; +import lombok.extern.slf4j.Slf4j; +import org.flowable.engine.test.Deployment; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mybatis.spring.annotation.MapperScan; +import org.security.Application; +import org.security.trans.common.dto.ExcelExportDTO; +import org.security.trans.common.dto.ExcelExportFieldDTO; +import org.security.trans.common.mapper.ExcelExportMapper; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.*; + +/** + * @author nantian.yangzhengyu + * @date 2023/11/13 10:04 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = Application.class) +@Slf4j +@MapperScan("org.security.trans.*.mapper") +public class ExcelExportServiceImplTest{ + @Resource + ExcelExportServiceImpl excelExportServiceImpl; + @Resource + ExcelExportMapper excelExportMapper; +// @Deployment +// public static JavaArchive createDeployment() { +// return ShrinkWrap.create(JavaArchive.class) +// .addClass(ExcelExportServiceImpl.class) +// .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); +// } + + @Test + public void exportData() throws ClassNotFoundException,NoSuchMethodException, + InstantiationException,IllegalAccessException, InvocationTargetException { + ExcelExportDTO excelExportDTO = ExcelExportDTO.builder() + .entityName("org.security.ht.entity.basic.Device") + .serviceName("org.security.trans.basic.service.impl.DeviceServiceImpl") + .build(); + List ids = new ArrayList<>(); + List fieldLists = new ArrayList<>(); + ExcelExportFieldDTO excelExportFieldDTO1 = ExcelExportFieldDTO.builder() + .fieldName("name") + .fieldNameCN("设备名称") + .fieldType("normal") + .build(); + ExcelExportFieldDTO excelExportFieldDTO2 = ExcelExportFieldDTO.builder() + .fieldName("deviceNum") + .fieldNameCN("设备编号") + .fieldType("normal") + .build(); + fieldLists.add(excelExportFieldDTO1); + fieldLists.add(excelExportFieldDTO2); + ids.add("1659403742498004994"); + ids.add("1659403742716108802"); + excelExportDTO.setIds(ids); + excelExportDTO.setFieldLists(fieldLists); + ExcelExportServiceImpl excelExportService = new ExcelExportServiceImpl(); + log.info("====excelExportService:[{}]",excelExportService); + excelExportService.exportData(null,excelExportDTO); + +// excelExportServiceImpl.exportData(null,excelExportDTO); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/FileServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/FileServiceImpl.java new file mode 100644 index 0000000..959a41f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/FileServiceImpl.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.common.service.impl; + +import cn.hutool.core.io.FileUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.config.CommonProperties; +import org.security.desk.feign.IImagesClient; +import org.security.ht.entity.common.File; +import org.security.trans.common.mapper.FileMapper; +import org.security.trans.common.service.IFileService; +import org.security.trans.common.service.UploadService; +import org.security.ht.vo.common.FileVO; +import org.security.ht.vo.common.UploadVO; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * 公共-附件表 服务实现类 + * + * @author BladeX + * @since 2022-07-04 + */ +@AllArgsConstructor +@Service +@Slf4j +public class FileServiceImpl extends ServiceImpl implements IFileService { + + private final UploadService uploadService; + private final IImagesClient iImagesClient; + private final CommonProperties commonProperties; + + @Override + public IPage selectFilePage(IPage page, FileVO file) { + return page.setRecords(baseMapper.selectFilePage(page, file)); + } + + @Override + public void saveAttachments(List relevantAttachments, String aimId) { + List list = new ArrayList<>(); + if (Func.isNotEmpty(relevantAttachments)) { + relevantAttachments.forEach(item -> { + if (Func.isEmpty(item.getId())) { + File file = new File(); + file.setId(item.getId()); + file.setFileName(item.getName()); + file.setLocalUrl(item.getUrl()); + file.setLinkId(String.valueOf(aimId)); + file.setContentId(item.getContentId()); + file.setDeptId(AuthUtil.getDeptId()); + file.setFormat(FileUtil.getSuffix(item.getName())); + file.setBusiBeginDate(item.getBusiBeginDate()); + file.setGroupName(item.getGroupName()); + file.setEncrypt(item.getEncrypt()); + list.add(file); + } + }); + this.saveBatch(list); + } + } + + @Override + public List getAttachments(String id, String groupName) { + List uploadVOList = new ArrayList<>(); + if (Func.isNotEmpty(id) && Func.isNotEmpty(groupName)) { + LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda() + .eq(File::getLinkId, String.valueOf(id)).eq(File::getGroupName, groupName) + .orderByDesc(File::getCreatedTime); + List list = this.list(queryWrapper); + if (Func.isNotEmpty(list)) { + list.forEach(item -> { + UploadVO uploadVO = Func.copy(item, UploadVO.class); + uploadVO.setFileType(item.getFormat()); + uploadVO.setName(item.getFileName().substring(item.getFileName().indexOf('-') + 1)); + uploadVO.setId(item.getId()); + uploadVO.setEncrypt(item.getEncrypt()); + if (Func.isNotEmpty(item.getLocalUrl())) { + //判断该文件是否存在于本地文件夹内 + java.io.File localFile = new java.io.File(item.getLocalUrl()); + //本地文件不存在 + if (!localFile.exists()) { + //调用影像平台 + R fileUrl = iImagesClient.getFileData(item.getBusiBeginDate(), item.getContentId(), item.getFileName()); + uploadVO.setUrl(fileUrl.getData()); + }//本地文件已经存在 + else { + R fileSavePath = iImagesClient.getFileSavePath(); + String url; + if (fileSavePath.isSuccess() && null != fileSavePath.getData() && fileSavePath.getData().length() >= 6) { + url = item.getLocalUrl().substring(fileSavePath.getData().length() - 6); + } else { + url = item.getLocalUrl(); + } + uploadVO.setUrl(url); + } + } + uploadVOList.add(uploadVO); + }); + } + return uploadVOList; + } + return uploadVOList; + } + + @Override + public boolean removeFileData(List detailIdList) { + ArrayList fileIdList = new ArrayList<>(); + detailIdList.forEach(item -> { + List list = this.list(new QueryWrapper().lambda().eq(Func.isNotBlank(item), File::getLinkId, item)); + if (Func.isNotEmpty(list)) { + list.forEach(f -> { + //删除本地服务器和影像平台相关附件 + removeServerFile(f); + //删除本地库数据记录 + fileIdList.add(f.getId()); + }); + } + }); + if (Func.isNotEmpty(fileIdList)) { + return this.removeByIds(fileIdList); + } + return true; + } + + /** + *删除本地服务器和影像平台相关附件 + */ + private boolean removeServerFile(File f) { + //移除本地服务器文件资源 + java.io.File file = new java.io.File(f.getLocalUrl()); + boolean b = file.delete(); + //本地服务器文件删除成功 + if (b){ + //移除影像平台附件资源 + R r = iImagesClient.removeFileData(f.getBusiBeginDate(), f.getContentId()); + if (!r.isSuccess()) { + return false; + } + } + return true; + } + + + @Override + public boolean removeFileData2(List detailIdList) { + List list = this.list(new QueryWrapper().lambda().in(Func.isNotEmpty(detailIdList), File::getId, detailIdList)); + if (Func.isNotEmpty(list)) { + list.forEach(file -> { + boolean b = removeServerFile(file); + if (b){ + this.removeByIds(detailIdList); + log.info("附件删除成功"); + }else { + log.error("本地服务器或影像平台删除附件失败"); + } + }); + return true; + }else { + return false; + } + } + + + @Override + public boolean update(MultipartFile file, String id) throws IOException { + UploadVO uploadVO = uploadService.uploadSingleFile(file, null, null); + uploadVO.setId(id); + File fileEntity = new File(); + fileEntity.setId(id); + fileEntity.setFormat(FileUtil.getSuffix(uploadVO.getName())); + fileEntity.setFileName(uploadVO.getName()); +// fileEntity.setUrl(uploadVO.getUrl()); + return this.updateById(fileEntity); + } + + @Override + public String getUserNameById(String userId) { + String userName=""; + if("-1".equals(userId)){ + userName="系统"; + } + else if(Func.isNotBlank(userId)){ + userName=baseMapper.getUserName(userId); + } + return userName; + } + + @Override + public String getUserNameByIds(List userIds) { + String userName=""; + List nameList = new ArrayList<>(); + if(Func.isNotEmpty(userIds) && userIds.size()>0){ + userIds.forEach(item->{ + String itemName=baseMapper.getUserName(item); + nameList.add(itemName); + }); + userName=String.join(",",nameList); + } + return userName; + } + + /*** + * 获取查询部门的ids + */ + @Override + public List setDeptIds(String aimDeptId,String includeChildren) { + List aimDepts = new ArrayList<>(); + if (Func.isNotEmpty(aimDeptId)) { + aimDepts.add(aimDeptId); + } + //包含子级机构 + if (Constant.INCLUDE_CHILDREN_TYPE_ONE.equals(includeChildren) && Func.isNotEmpty(aimDeptId)) { + //获取子级机构id + List deptIdList = baseMapper.getChildrenDeptId(aimDeptId); + aimDepts.addAll(deptIdList); + } + return aimDepts; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/Oauth2ServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/Oauth2ServiceImpl.java new file mode 100644 index 0000000..dc2a845 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/Oauth2ServiceImpl.java @@ -0,0 +1,139 @@ +package org.security.trans.common.service.impl; + +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.security.common.config.AppOauth2Propertis; +import org.security.system.user.entity.User; +import org.security.system.user.vo.UserVO; +import org.security.trans.common.dto.AccessTokenDTO; +import org.security.trans.common.dto.AuthResult; +import org.security.trans.common.dto.UserDetailDTO; +import org.security.trans.common.service.Oauth2Service; +import org.security.trans.feign.UserFeignClient; +import org.springblade.core.launch.constant.TokenConstant; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.TokenInfo; +import org.springblade.core.secure.utils.SecureUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * @author zj 2022/7/4 + */ +@Slf4j +@AllArgsConstructor +@Service +public class Oauth2ServiceImpl implements Oauth2Service { + + private final AppOauth2Propertis appOauth2Propertis; + private final UserFeignClient userFeignClient; + + @Override + public String appOauth(HttpServletRequest request) { + log.info("================app端单点登录授权开始================"); + String ticket = request.getParameter("ticket"); + //1.获取accesstok + String accessToken = getAccessToken(); + if (StringUtils.isBlank(accessToken)) { + return "获取授权失败"; + } + //2.获取用户上线文信息 + UserDetailDTO userDetailDTO = getUserContext(ticket, accessToken); + if (Objects.isNull(userDetailDTO)) { + return "获取用户信息失败"; + } + //3.对比用户 + User user = new User(); + user.setRealName(user.getName()); + R detailResult = userFeignClient.detail(user); + if (!detailResult.isSuccess()) { + return "获取用户信息失败"; + } + UserVO userVO = detailResult.getData(); + if (Objects.isNull(userVO)) { + return "系统不存在当前用户"; + } + TokenInfo jwt = SecureUtil.createJWT(getTokenMap(userVO), "app", "security", "access_token"); + log.info("================app端单点登录授权结束================"); + return "redirect:" + + appOauth2Propertis.getAppIndexUrl() + + "?ticket=" + ticket + + "&token=" + jwt.getToken(); + + } + + @Override + public String pcOauth() { + return null; + } + + private UserDetailDTO getUserContext(String ticket, String accessToken) { + HashMap userContextMap = new HashMap<>(2); + userContextMap.put("appid", appOauth2Propertis.getAppId()); + userContextMap.put("ticket", ticket); + String getUserStr = JSON.toJSONString(userContextMap); + log.info("================获取用户上下文信息:{}================", getUserStr); + HttpRequest userPost = HttpUtil.createPost(appOauth2Propertis.getUserContextUrl() + "?accessToken=" + accessToken); + HttpRequest httpRequest = userPost.body(getUserStr, "application/json"); + HttpResponse httpResponse = httpRequest.execute(); + if (!httpResponse.isOk()) { + throw new ServiceException("获取用户信息上下文失败"); + } + String userContext = httpResponse.body(); + AuthResult authResult = JSON.parseObject(userContext, new TypeReference>() { + }); + return authResult.getData(); + } + + private String getAccessToken() { + HashMap tokenMap = new HashMap<>(4); + tokenMap.put("appId", appOauth2Propertis.getAppId()); + tokenMap.put("secret", appOauth2Propertis.getSecret()); + tokenMap.put("timestamp", String.valueOf(System.currentTimeMillis())); + tokenMap.put("scope", "app"); + String accessTokenBodyJson = JSON.toJSONString(tokenMap); + log.info("================获取accessToken:{}================", accessTokenBodyJson); + HttpRequest post = HttpUtil.createPost(appOauth2Propertis.getAccessTokenUrl()); + post.body(accessTokenBodyJson, "application/json"); + HttpResponse response = post.execute(); + if (!response.isOk()) { + throw new ServiceException("获取accsssToken失败"); + } + String accessTokenBody = response.body(); + AuthResult accessTokenResult = JSON.parseObject(accessTokenBody, new TypeReference>() { + }); + return accessTokenResult.getData().getRefreshToken(); + } + + private Map getTokenMap(UserVO userVO) { + Map info = new HashMap<>(16); + info.put(TokenConstant.CLIENT_ID, "app"); + info.put(TokenConstant.USER_ID, Func.toStr(userVO.getId())); + info.put(TokenConstant.DEPT_ID, Func.toStr(userVO.getDeptId())); + info.put(TokenConstant.POST_ID, Func.toStr(userVO.getPostId())); + info.put(TokenConstant.ROLE_ID, Func.toStr(userVO.getRoleId())); + info.put(TokenConstant.TENANT_ID, userVO.getTenantId()); + info.put(TokenConstant.OAUTH_ID, ""); + info.put(TokenConstant.ACCOUNT, userVO.getAccount()); + info.put(TokenConstant.USER_NAME, userVO.getRealName()); + info.put(TokenConstant.NICK_NAME, userVO.getName()); + info.put(TokenConstant.REAL_NAME, userVO.getRealName()); + info.put(TokenConstant.ROLE_NAME, userVO.getRoleName()); + info.put(TokenConstant.AVATAR, userVO.getAvatar()); + info.put(TokenConstant.DETAIL, "web"); + info.put(TokenConstant.LICENSE, "security"); + return info; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/UploadServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/UploadServiceImpl.java new file mode 100644 index 0000000..cad2d6c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/common/service/impl/UploadServiceImpl.java @@ -0,0 +1,71 @@ +package org.security.trans.common.service.impl; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.owasp.esapi.ESAPI; +import org.security.trans.common.service.UploadService; +import org.security.ht.vo.common.UploadVO; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * @author zj 2022/5/11 + */ +@Slf4j +@AllArgsConstructor +@Service +public class UploadServiceImpl implements UploadService { + + @Override + public UploadVO uploadSingleFile(MultipartFile file, String groupType, String groupName) throws IOException { + //将文件存储在本地 + String fileName = file.getOriginalFilename(); + String filePath = "E:\\安防信息化项目\\uploadFile"; + // if (!ESAPI.validator().isValidFileName("upload", fileName, false)) { + // throw new IOException("非法的文件名"); + // } + File dest = new File(new File(filePath).getAbsoluteFile() + File.separator + fileName); + dest.createNewFile(); + try { + file.transferTo(dest); + log.info("文件上传本地成功"); + }catch (IOException e){ + log.error("文件上传本地失败"+e); + } + //将文件信息告知影像平台 + + return UploadVO.builder() + .name(fileName) + .fileType(StringUtils.substring(fileName, fileName.lastIndexOf('.') + 1)) + .url(filePath) + .groupName(groupName) + .build(); + } + + @Override + public List uploadListFile(List files, String groupType, String groupName) { + ArrayList res = new ArrayList<>(); +// for (MultipartFile file : files) { +// try { +// String originalFileName = file.getOriginalFilename(); +// BladeFile bladeFile = qiniuTemplate.putFile(ossProperties.getBucketName(), originalFileName, file.getInputStream()); +// UploadVO uploadVO = new UploadVO(); +// uploadVO.setName(originalFileName); +// uploadVO.setFileType(StringUtils.substring(originalFileName, originalFileName.lastIndexOf(".") + 1)); +// uploadVO.setUrl(bladeFile.getLink()); +// uploadVO.setGroupType(groupType); +// uploadVO.setGroupName(groupName); +// res.add(uploadVO); +// } catch (IOException e) { +// log.error("上传文件异常:", e); +// } +// } + return res; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/DeviceInspectionController.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/DeviceInspectionController.java new file mode 100644 index 0000000..18f61e4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/DeviceInspectionController.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.dailyDuties.dto.DeviceInspectionDTO; +import org.security.trans.dailyDuties.dto.DeviceInspectionLineDTO; +import org.security.trans.dailyDuties.vo.DeviceInspectionLineVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dailyDuties.vo.DeviceInspectionVO; +import org.security.trans.dailyDuties.service.IDeviceInspectionService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 任务-设备检查表 控制器 + * + * @author BladeX + * @since 2022-03-25 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/deviceinspection") +@Api(value = "任务-设备检查表", tags = "任务-设备检查表接口") +public class DeviceInspectionController extends BladeController { + + private final IDeviceInspectionService deviceInspectionService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入deviceInspection") + public R detail(@PathVariable String id) { + return R.data(deviceInspectionService.getData(id)); + } + + /** + * 分页 任务-设备检查表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入deviceInspection") + public R> list(DeviceInspection deviceInspection, Query query) { + IPage pages = deviceInspectionService.page(Condition.getPage(query), Condition.getQueryWrapper(deviceInspection)); + return R.data(pages); + } + + /** + * 自定义分页 任务-设备检查表 + * create:qx + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入deviceInspection") + public R> page(DeviceInspectionDTO deviceInspectionDTO, Query query) { + IPage pages = deviceInspectionService.selectDeviceInspectionPage(Condition.getPage(query), deviceInspectionDTO); + return R.data(pages); + } + + /** + * 新增 任务-设备检查表 + * create:qx + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入deviceInspection") + public R save(@Valid @RequestBody DeviceInspection deviceInspection) { + return R.status(deviceInspectionService.save(deviceInspection)); + } + + /** + * 修改 任务-设备检查表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入deviceInspection") + public R update(@Valid @RequestBody DeviceInspection deviceInspection) { + return R.status(deviceInspectionService.updateById(deviceInspection)); + } + + /** + * 新增或修改 任务-设备检查表 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入deviceInspection") + public R submit(@Valid @RequestBody DeviceInspection deviceInspection) { + return R.status(deviceInspectionService.saveOrUpdate(deviceInspection)); + } + + + /** + * 删除 任务-设备检查表 + * create:qx + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(deviceInspectionService.removeDeviceInspectionAndLineByIds(Func.toLongList(ids))); + } + + /** + * 创建 任务-设备检查表 + * create:qx + */ + @PostMapping("/create") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "创建", notes = "deviceInspectionDTO") + public R create(@Valid @RequestBody DeviceInspectionDTO deviceInspectionDTO) { + return deviceInspectionService.createDeviceInspection(deviceInspectionDTO); + } + + + /** + * 修改状态 任务-监督检查 + * create:qx + */ + @PostMapping("/change") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "修改", notes = "deviceInspectionLineDTO") + public R update(@Valid @RequestBody DeviceInspectionLineDTO deviceInspectionLineDTO) { + return R.data(deviceInspectionService.changeStateById(deviceInspectionLineDTO)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/DeviceInspectionLineController.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/DeviceInspectionLineController.java new file mode 100644 index 0000000..3981516 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/DeviceInspectionLineController.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.validation.Valid; + +import org.security.trans.dailyDuties.dto.DeviceInspectionLineDTO; +import org.security.trans.dailyDuties.vo.DevicePictureVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import org.security.trans.dailyDuties.vo.DeviceInspectionLineVO; +import org.security.trans.dailyDuties.service.IDeviceInspectionLineService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.util.List; + +/** + * 任务-设备检查明细 控制器 + * + * @author BladeX + * @since 2022-03-25 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/deviceinspectionline") +@Api(value = "任务-设备检查明细", tags = "任务-设备检查明细接口") +public class DeviceInspectionLineController extends BladeController { + + private final IDeviceInspectionLineService deviceInspectionLineService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入deviceInspectionLine") + public R detail(@PathVariable String id) { + return R.data(deviceInspectionLineService.getDetailData(id)); + } + + /** + * 分页 任务-设备检查明细 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入deviceInspectionLine") + public R> list(DeviceInspectionLine deviceInspectionLine, Query query) { + IPage pages = deviceInspectionLineService.page(Condition.getPage(query), Condition.getQueryWrapper(deviceInspectionLine)); + return R.data(pages); + } + + /** + * 自定义分页 任务-设备检查明细 + * create:qx + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入deviceInspectionLine") + public R> page(DeviceInspectionLineDTO deviceInspectionLineDTO, Query query) { + IPage pages = deviceInspectionLineService.selectDeviceInspectionLinePage(Condition.getPage(query), deviceInspectionLineDTO); + return R.data(pages); + } + + /** + * 新增 任务-设备检查明细 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入deviceInspectionLine") + public R save(@Valid @RequestBody DeviceInspectionLine deviceInspectionLine) { + return R.status(deviceInspectionLineService.save(deviceInspectionLine)); + } + + /** + * 修改 任务-设备检查明细 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入deviceInspectionLine") + public R update(@Valid @RequestBody DeviceInspectionLine deviceInspectionLine) { + return R.status(deviceInspectionLineService.updateById(deviceInspectionLine)); + } + + /** + * 新增或修改 任务-设备检查明细 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入deviceInspectionLine") + public R submit(@Valid @RequestBody DeviceInspectionLine deviceInspectionLine) { + return R.status(deviceInspectionLineService.saveOrUpdate(deviceInspectionLine)); + } + + + /** + * 删除 任务-设备检查明细 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(deviceInspectionLineService.removeByIds(Func.toLongList(ids))); + } + + /** + * 获取整改前后图片 + */ + @GetMapping("/picture/{id}") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "获取整改前后图片", notes = "id") + public R picture(@PathVariable String id) { + return R.data(deviceInspectionLineService.getPicture(id)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/InspectionController.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/InspectionController.java new file mode 100644 index 0000000..8106681 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/InspectionController.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.dailyDuties.dto.InspectionDTO; +import org.security.trans.flow.dto.FlowStartDTO; +import org.security.trans.task.dto.TaskHandinDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.dailyDuties.vo.InspectionVO; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.text.ParseException; + +/** + * 任务-监督检查表 控制器 + * + * @author BladeX + * @since 2022-03-25 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/inspection") +@Api(value = "任务-监督检查表", tags = "任务-监督检查表接口") +public class InspectionController extends BladeController { + + private final IInspectionService inspectionService; + + /** + * 详情 + * create:qx + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入inspection") + public R detail(@PathVariable String id) { + return R.data(inspectionService.getInspectionData(id)); + } + + /** + * 分页 任务-监督检查表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入inspection") + public R> list(Inspection inspection, Query query) { + IPage pages = inspectionService.page(Condition.getPage(query), Condition.getQueryWrapper(inspection)); + return R.data(pages); + } + + /** + * 自定义分页 任务-监督检查表 + * create:qx + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入inspection") + public R> page(InspectionDTO inspectionDTO, Query query) { + IPage pages = inspectionService.selectInspectionPage(Condition.getPage(query), inspectionDTO); + return R.data(pages); + } + + /** + * 新增/修改/暂存 任务-监督检查表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入inspection") + public R update(@Valid @RequestBody InspectionDTO inspection) { + return inspectionService.saveOrUpdateInspection(inspection); + } + + /** + * 提报检查结果 任务-监督检查表 + */ + @PostMapping("/handin") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "提报", notes = "传入inspection") + public R handin(@Valid @RequestBody InspectionDTO inspection){ + return inspectionService.handin(inspection); + } + + /** + * 删除 任务-监督检查表 + * create:qx + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(inspectionService.removeInspectionAndLineByIds(Func.toLongList(ids))); + } + + /** + * 整改结果提报 + * create:qx + */ + @PostMapping("/change") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "整改结果提报", notes = "id") + public R update(@ApiParam(value = "主键", required = true)@RequestParam String id) throws ParseException { + return inspectionService.changeStateById(id); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/InspectionLineController.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/InspectionLineController.java new file mode 100644 index 0000000..8650939 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/controller/InspectionLineController.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.dailyDuties.dto.InspectionLineDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dailyDuties.entity.InspectionLine; +import org.security.trans.dailyDuties.vo.InspectionLineVO; +import org.security.trans.dailyDuties.service.IInspectionLineService; +import org.springblade.core.boot.ctrl.BladeController; +import org.springframework.web.multipart.MultipartFile; + +import java.text.ParseException; + +/** + * 任务-监督检查明细 控制器 + * + * @author BladeX + * @since 2022-03-25 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/inspectionline") +@Api(value = "任务-监督检查明细", tags = "任务-监督检查明细接口") +public class InspectionLineController extends BladeController { + + private final IInspectionLineService inspectionLineService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + InspectionLine detail = inspectionLineService.getDetail(id); + return R.data(detail); + } + + /** + * 分页 任务-监督检查明细 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入inspectionLine") + public R> list(InspectionLine inspectionLine, Query query) { + IPage pages = inspectionLineService.page(Condition.getPage(query), Condition.getQueryWrapper(inspectionLine)); + return R.data(pages); + } + + /** + * 自定义分页 任务-监督检查明细 + * create:qx + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入inspectionLine") + public R> page(InspectionLineDTO inspectionLineDTO, Query query) { + IPage linePage = inspectionLineService.selectInspectionLinePage(Condition.getPage(query), inspectionLineDTO); + return R.data(linePage); + } + + + /** + * 提交明细检查整改结果 任务-监督检查明细 + */ + @PostMapping("/handinRectify") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "id") + public R handin(@Valid @RequestBody InspectionLineDTO inspectionLineDTO) throws ParseException { + return R.status(inspectionLineService.handinRectify(inspectionLineDTO)); + } + + /** + * 新增 任务-监督检查明细 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入inspectionLine") + public R save(@Valid @RequestBody InspectionLine inspectionLine) { + return R.status(inspectionLineService.save(inspectionLine)); + } + + /** + * 修改 任务-监督检查明细 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入inspectionLine") + public R update(@Valid @RequestBody InspectionLineDTO inspectionLine) { + return R.status(inspectionLineService.saveInspectionLine(inspectionLine)); + } + + /** + * 新增或修改 任务-监督检查明细 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入inspectionLine") + public R submit(@Valid @RequestBody InspectionLine inspectionLine) { + return R.status(inspectionLineService.saveOrUpdate(inspectionLine)); + } + + + /** + * 删除 任务-监督检查明细 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(inspectionLineService.removeByIds(Func.toLongList(ids))); + } + + + /** + * 导入检查明细 + */ + @PostMapping("/import/data") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "导入检查明细", notes = "传入file") + public R saveInspectionlineData(String id, MultipartFile file) throws ParseException { + return R.status(inspectionLineService.saveData(id,file)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/DeviceInspectionDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/DeviceInspectionDTO.java new file mode 100644 index 0000000..3d681ac --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/DeviceInspectionDTO.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * 任务-设备检查表数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DeviceInspectionDTO extends DeviceInspection { + private static final long serialVersionUID = 1L; + private String ids; + @ApiModelProperty(value = "统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级)") + private String includeChildren; + /** + * 检查时间起 用于查询列表时按照检查时间筛选 + */ + @ApiModelProperty(value = "检查时间起") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + private Date inspectTimeBegin; + + /** + * 检查时间止 用于查询列表时按照检查时间筛选 + */ + @ApiModelProperty(value = "检查时间止") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME) + private Date inspectTimeEnd; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/DeviceInspectionLineDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/DeviceInspectionLineDTO.java new file mode 100644 index 0000000..fd89215 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/DeviceInspectionLineDTO.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.dto; + +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 任务-设备检查明细数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DeviceInspectionLineDTO extends DeviceInspectionLine { + private static final long serialVersionUID = 1L; + private String ids; + + /** + * 设备整改记录标识符(1-普通整改,2-持续整改,3-设备检查) + */ + private String rectifyFlag; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionDTO.java new file mode 100644 index 0000000..b8bdcef --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionDTO.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.dto; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.entity.Inspection; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.dailyDuties.entity.InspectionLine; + +import java.util.List; + +/** + * 任务-监督检查表数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class InspectionDTO extends Inspection { + private static final long serialVersionUID = 1L; + private String orgInspectDep; + private String deviceFlag; + private String submitFlag; + List inspectionLineList; + @ApiModelProperty(value = "统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级)") + private String includeChildren; + /** + * 模块标识符 + */ + private String bizTypeStr; + @ApiModelProperty(value = "相关附件") + private List fileList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionLineDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionLineDTO.java new file mode 100644 index 0000000..c2502e0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionLineDTO.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.entity.InspectionLine; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; +import java.util.List; + +/** + * 任务-监督检查明细数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class InspectionLineDTO extends InspectionLine { + private static final long serialVersionUID = 1L; + /** + * 主表字符串,逗号分隔 + */ + private String formIds; + + @ApiModelProperty(value = "整改前照片") + private List checkPicList; + @ApiModelProperty(value = "整改后照片") + private List rectifyPicList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionLineExcelDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionLineExcelDTO.java new file mode 100644 index 0000000..50d6178 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/dto/InspectionLineExcelDTO.java @@ -0,0 +1,92 @@ +package org.security.trans.dailyDuties.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author Create by wzf + * @date 2022/6/9 15:51 + */ +@Data +public class InspectionLineExcelDTO implements Serializable { + /** + * 涉及业务 + */ + @ApiModelProperty(value = "涉及业务") + @ExcelProperty(value = "涉及业务") + private String businessType; + /** + * 问题类型 + */ + @ApiModelProperty(value = "问题类型") + @ExcelProperty(value = "问题类型") + private String problemType; + /** + * 问题事实描述 + */ + @ApiModelProperty(value = "异常情况说明") + @ExcelProperty(value = "异常情况说明") + private String description; + /** + * 问题等级 + */ + @ApiModelProperty(value = "问题等级") + @ExcelProperty(value = "问题等级") + private String problemLevel; + /** + * 整改建议 + */ + @ApiModelProperty(value = "整改建议") + @ExcelProperty(value = "整改建议") + private String advice; + /** + * 问题发生日期 + */ + @ApiModelProperty(value = "问题发生日期") + @ExcelProperty(value = "问题发生日期") + private String happenDate; + /** + * 检查发现日期 + */ + @ApiModelProperty(value = "检查发现日期") + @ExcelProperty(value = "检查发现日期") + private String foundDate; + /** + * 整改期限 + */ + @ApiModelProperty(value = "整改期限") + @ExcelProperty(value = "整改期限") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectifyDeadline; + /** + * 整改完成日期 + */ + @ApiModelProperty(value = "整改完成日期") + @ExcelProperty(value = "整改完成日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectifyDate; + /** + * 检查项 + */ + @ApiModelProperty(value = "检查内容") + @ExcelProperty(value = "检查内容") + private String content; + /** + * 是否存在问题 + */ + @ApiModelProperty(value = "是否有异常") + @ExcelProperty(value = "是否有异常") + private String hasProblem; + /** + * 整改情况说明 + */ + @ApiModelProperty(value = "整改情况说明") + @ExcelProperty(value = "整改情况说明") + private String rectifyDescribe; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/DeviceInspection.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/DeviceInspection.java new file mode 100644 index 0000000..dbdc741 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/DeviceInspection.java @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.entity.common.FlowEntity; + +import java.io.Serializable; +import java.util.Date; + +/** + * 任务-设备检查表实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@TableName("T_DEVICE_INSPECTION") +@ApiModel(value = "DeviceInspection对象", description = "任务-设备检查表") +public class DeviceInspection extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 设备ID + */ + @ApiModelProperty(value = "设备ID") + @TableField("DEVICE_ID") + private String deviceId; + /** + * 设备类型 + */ + @ApiModelProperty(value = "设备类型") + @TableField("DEVICE_TYPE") + private String deviceType; + /** + * 设备名称 + */ + @ApiModelProperty(value = "设备名称") + @TableField("DEVICE_NAME") + private String deviceName; + /** + * 设备型号 + */ + @ApiModelProperty(value = "设备型号") + @TableField("DEVICE_MODEL_NUM") + private String deviceModelNum; + /** + * 设备编号 + */ + @ApiModelProperty(value = "设备编号") + @TableField("DEVICE_NUM") + private String deviceNum; + /** + * 检查机构 + */ + @ApiModelProperty(value = "检查机构") + @TableField("CREATE_DEPT_ID") + private String createDeptId; + /** + * 检查人 + */ + @ApiModelProperty(value = "检查人") + @TableField("INSPECT_USER") + private String inspectUser; + /** + * 整改人 + */ + @ApiModelProperty(value = "整改人") + @TableField("RECTIFY_USER") + private String rectifyUser; + + /** + * 审核人 + */ + @ApiModelProperty(value = "审核人") + @TableField("AUDIT_USER") + private String auditUser; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARK") + private String remark; + /** + * 状态 + */ + @ApiModelProperty(value = "状态;4-检查中,5-检查完成,6-待整改,7-整改完成") + @TableField("STATUS") + private String status; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + @ApiModelProperty(value = "检查期限") + @TableField("CHECK_DEADLINE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date checkDeadline; + + @ApiModelProperty(value = "检查时间") + @TableField("INSPECT_TIME") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date inspectTime; + + @ApiModelProperty(value = "办结时间") + @TableField("FINISH_TIME") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date finishTime; + + /** + * 检查流程定义id + */ + @ApiModelProperty(value = "检查流程定义id") + @TableField("INS_PROCESS_DEFINITION_ID") + private String insProcessDefinitionId; + + /** + * 检查流程实例id + */ + @ApiModelProperty(value = "检查流程实例id") + @TableField("INS_PROCESS_INSTANCE_ID") + private String insProcessInstanceId; + + /** + * 整改流程定义id + */ + @ApiModelProperty(value = "整改流程定义id") + @TableField("REC_PROCESS_DEFINITION_ID") + private String recProcessDefinitionId; + + /** + * 整改流程实例id + */ + @ApiModelProperty(value = "整改流程实例id") + @TableField("REC_PROCESS_INSTANCE_ID") + private String recProcessInstanceId; + + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @TableField("dept_name") + private String deptName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/DeviceInspectionLine.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/DeviceInspectionLine.java new file mode 100644 index 0000000..139b42a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/DeviceInspectionLine.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.FlowEntity; + +/** + * 任务-设备检查明细实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@TableName("T_DEVICE_INSPECTION_LINE") +@ApiModel(value = "DeviceInspectionLine对象", description = "任务-设备检查明细") +public class DeviceInspectionLine extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 设备检查表ID + */ + @ApiModelProperty(value = "设备检查表ID") + @TableField("FORM_ID") + private String formId; + /** + * 检查项名称 + */ + @ApiModelProperty(value = "检查项名称") + @TableField("NAME") + private String name; + /** + * 检查结果 + */ + @ApiModelProperty(value = "检查结果") + @TableField("RESULT") + private String result; + /** + * 检查结果状态(1-正常,2-异常) + */ + @ApiModelProperty(value = "检查结果状态(1-正常,2-异常)") + @TableField("PROBLEM_LEVEL") + private String problemLevel; + + /** + * 整改结果状态(1-正常,2-告警) + */ + @ApiModelProperty(value = "整改结果状态(1-正常,2-告警)") + @TableField("RECTIFICATION_STATUS") + private String rectificationStatus; + + /** + * 状态(4-检查中;5-检查完成,6-待整改,7-整改完成,8-超期未检查) + */ + @ApiModelProperty(value = "状态(4-检查中;5-检查完成,6-待整改,7-整改完成,8-超期未检查)") + @TableField("STATUS") + private String status; + + /** + * 状态;0-待检 1-已检 2-已整改 + */ + @ApiModelProperty(value = "状态;0-待检 1-已检 2-已整改") + @TableField("DEVICE_STATE") + private String deviceState; + /** + * 整改前图片附件标识groupName + */ + @ApiModelProperty(value = "整改前图片附件标识groupName") + @TableField("BEFORE_PIC_IDS") + private String beforePicIds; + + /** + * 整改后图片附件标识groupName + */ + @ApiModelProperty(value = "整改后图片附件标识groupName") + @TableField("AFTER_PIC_IDS") + private String afterPicIds; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + /** + * 持续整改期限 + */ + @ApiModelProperty(value = "持续整改期限") + @TableField("rectification_deadline") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectificationDeadline; + + + /** + * 类型标识(1-普通整改,2-持续整改) + */ + @ApiModelProperty(value = "类型标识(1-普通整改,2-持续整改)") + @TableField("rec_flag") + private String recFlag; + + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + + /** + * 整改结果 + */ + @ApiModelProperty(value = "整改结果") + @TableField("rectify_result") + private String rectifyResult; + + + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @TableField("dept_name") + private String deptName; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/Inspection.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/Inspection.java new file mode 100644 index 0000000..cae82ee --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/Inspection.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.FlowEntity; + +/** + * 任务-监督检查表实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@TableName("T_INSPECTION") +@ApiModel(value = "Inspection对象", description = "任务-监督检查表") +public class Inspection extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 任务类型 usual-日常类 unusual-专项类 + */ + @ApiModelProperty(value = "任务类型 usual-日常类 unusual-专项类") + @TableField("TYPE") + private String type; + /** + * 检查类型 1-自检自查 2-内部检查 3-外部检查 + */ + @ApiModelProperty(value = "检查类型 1-自检自查 2-内部检查 3-外部检查") + @TableField("CHECK_TYPE") + private String checkType; + + /** + * 关联任务ID + */ + @ApiModelProperty(value = "关联任务ID") + @TableField("TASK_ID") + private String taskId; + /** + * 关联任务编号 + */ + @ApiModelProperty(value = "关联任务编号") + @TableField("TASK_NUM") + private String taskNum; + /** + * 检查人 + */ + @ApiModelProperty(value = "检查人") + @TableField("INSPECT_USER") + private String inspectUser; + /** + * 检查日期 + */ + @ApiModelProperty(value = "检查日期") + @TableField("INSPECT_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date inspectDate; + /** + * 检查机构 + */ + @ApiModelProperty(value = "检查机构") + @TableField("INSPECT_DEP") + private String inspectDep; + + /** + * 被检查机构 + */ + @ApiModelProperty(value = "被检查机构") + @TableField("INSPECTED_DEP") + private String inspectedDep; + /** + * 整改负责人 + */ + @ApiModelProperty(value = "整改负责人") + @TableField("RECTIFY_USER") + private String rectifyUser; + /** + * 整改期限 + */ + @ApiModelProperty(value = "整改期限") + @TableField("RECTIFY_DEADLINE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectifyDeadline; + /** + * 检查附件groupname + */ + @ApiModelProperty(value = "检查附件groupname") + @TableField("FILE_IDS") + private String fileIds; + /** + * 整改附件 + */ + @ApiModelProperty(value = "整改附件") + @TableField("RECTIFY_FILE_IDS") + private String rectifyFileIds; + + /** + * 业务状态(0-检查待提交,1-超时待检查,2-待整改,3-已整改,4-超时未整改,5-超时已整改,6-正常已提报,7-任务已终止) + */ + @ApiModelProperty(value = "业务状态(0-检查待提交,1-超时待检查,2-待整改,3-已整改,4-超时未整改,5-超时已整改,6-正常已提报,7-任务已终止)") + @TableField("STATUS") + private String status; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 所属模块 + */ + @ApiModelProperty(value = "所属模块") + @TableField("MODULE") + private String module; + /** + * 检查结果是否存在异常(0-否,1-是) + */ + @ApiModelProperty(value = "检查结果是否存在异常(0-否,1-是)") + @TableField("CHECK_STATUS") + private String checkStatus; + /** + * 是否整改完成(0-否,1-是) + */ + @ApiModelProperty(value = "是否整改完成(0-否,1-是)") + @TableField("RECTIFY_STATUS") + private String rectifyStatus; + /** + * 提报期限 + */ + @ApiModelProperty(value = "提报期限") + @TableField("DEADLINE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date deadline; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("NOTE") + private String note; + /** + * 提报用户 + */ + @ApiModelProperty(value = "提报用户") + @TableField("USER_ID") + private String userId; + /** + * 提报角色 + */ + @ApiModelProperty(value = "提报角色") + @TableField("ROLE_ID") + private String roleId; + /** + * 业务类型 + */ + @ApiModelProperty(value = "业务类型") + @TableField("BUSINESS_TYPE") + private String businessType; + + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @TableField("dept_name") + private String deptName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/InspectionLine.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/InspectionLine.java new file mode 100644 index 0000000..dbe2959 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/entity/InspectionLine.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.FlowEntity; + +/** + * 任务-监督检查明细实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@TableName("T_INSPECTION_LINE") +@ApiModel(value = "InspectionLine对象", description = "任务-监督检查明细") +public class InspectionLine extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 检查表ID + */ + @ApiModelProperty(value = "检查表ID") + @TableField("FORM_ID") + private String formId; + /** + * 检查表状态 + */ + @ApiModelProperty(value = "检查表状态") + @TableField("FORM_STATUS") + private String formStatus; + /** + * 涉及业务 + */ + @ApiModelProperty(value = "涉及业务") + @TableField("BUSINESS_TYPE") + private String businessType; + /** + * 问题类型 + */ + @ApiModelProperty(value = "问题类型") + @TableField("PROBLEM_TYPE") + private String problemType; + /** + * 异常情况说明 + */ + @ApiModelProperty(value = "异常情况说明") + @TableField("DESCRIPTION") + private String description; + /** + * 问题等级 + */ + @ApiModelProperty(value = "问题等级") + @TableField("PROBLEM_LEVEL") + private String problemLevel; + /** + * 整改建议 + */ + @ApiModelProperty(value = "整改建议") + @TableField("ADVICE") + private String advice; + /** + * 问题发生日期 + */ + @ApiModelProperty(value = "问题发生日期") + @TableField("HAPPEN_DATE") + private String happenDate; + /** + * 检查日期 + */ + @ApiModelProperty(value = "检查日期") + @TableField("FOUND_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date foundDate; + /** + * 审批状态;0-待提报审批、1-审批中、2-审批完成 + */ + @ApiModelProperty(value = "审批状态") + @TableField("STATE") + private String state; + /** + * 整改期限 + */ + @ApiModelProperty(value = "整改期限") + @TableField("RECTIFY_DEADLINE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectifyDeadline; + /** + * 整改完成日期 + */ + @ApiModelProperty(value = "整改完成日期") + @TableField("RECTIFY_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectifyDate; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 业务状态(6-无需整改、2-待整改、3-已整改、4-超时未整改、5-超时已整改) + */ + @ApiModelProperty(value = "业务状态(6-无需整改、2-待整改、3-已整改、4-超时未整改、5-超时已整改)") + @TableField("STATUS") + private String status; + /** + * 类型标识 1-普通类型 2-持续整改后续补充的记录 + */ + @ApiModelProperty(value = "类型标识") + @TableField("FLAG") + private String flag; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 提报用户 + */ + @ApiModelProperty(value = "提报用户") + @TableField("USER_ID") + private String userId; + /** + * 提报角色 + */ + @ApiModelProperty(value = "提报角色") + @TableField("ROLE_ID") + private String roleId; + /** + * 检查内容 + */ + @ApiModelProperty(value = "检查内容") + @TableField("CONTENT") + private String content; + /** + * 是否有异常 + */ + @ApiModelProperty(value = "是否有异常 0-否,1-是") + @TableField("HAS_PROBLEM") + private String hasProblem; + /** + * 检查时照片groupname + */ + @ApiModelProperty(value = "检查时照片groupname") + @TableField("CHECK_PIC") + private String checkPic; + /** + * 整改后照片groupname + */ + @ApiModelProperty(value = "整改后照片groupname") + @TableField("RECTIFY_PIC") + private String rectifyPic; + /** + * 整改说明 + */ + @ApiModelProperty(value = "整改说明") + @TableField("RECTIFY_DESCRIBE") + private String rectifyDescribe; + /** + * 需要持续整改 0-否 1-是 + */ + @ApiModelProperty(value = "需要持续整改") + @TableField("NEED_CONTINUE") + private String needContinue; + /** + * 持续整改期限 + */ + @ApiModelProperty(value = "持续整改期限") + @TableField("NEW_DEADLINE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date newDeadline; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionLineMapper.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionLineMapper.java new file mode 100644 index 0000000..ffbcc97 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionLineMapper.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import org.security.trans.dailyDuties.vo.DeviceInspectionLineVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 任务-设备检查明细 Mapper 接口 + * + * @author BladeX + * @since 2022-03-25 + */ +public interface DeviceInspectionLineMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param deviceInspectionLine + * @return + */ + List selectDeviceInspectionLinePage(IPage page, DeviceInspectionLineVO deviceInspectionLine); + + /** + * 获取设备持续整改信息 + * @param deptId 用户所属部门id + * @param stateList 待办对应的状态:待整改状态、已整改状态(但被驳回) + * @param problemStateContinued 持续整改记录标识 + * @return + */ + List getData(@Param("deptId") String deptId,@Param("stateList") List stateList,@Param("problemStateContinued") String problemStateContinued); + +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List getContinuedRectifyData(@Param("aimDepts") List aimDepts); + + /** + * 获取设备整改记录信息 + * @param formId 主表记录id + * @return + */ + DeviceInspection getDeviceInspection(@Param("formId") String formId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionLineMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionLineMapper.xml new file mode 100644 index 0000000..5355bfa --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionLineMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionMapper.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionMapper.java new file mode 100644 index 0000000..15cec8b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionMapper.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.DeviceInspectionDataDTO; +import org.security.trans.dataStatistics.vo.DeviceInspectionDataVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 任务-设备检查表 Mapper 接口 + * + * @author BladeX + * @since 2022-03-25 + */ +public interface DeviceInspectionMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param wrapper + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + @Select("SELECT * FROM T_DEVICE_INSPECTION ${ew.customSqlSegment}") + IPage selectDeviceInspectionPage(Page page, @Param(Constants.WRAPPER) Wrapper wrapper); + + /** + *获取app待办信息 + * @param userDeptId + * @param list + * @return + */ + List getAppBacklog(@Param("userDeptId") String userDeptId, @Param("toLongList")List list); + + List getAimStatisticsData(@Param("deviceInspectionDataDTO") DeviceInspectionDataDTO deviceInspectionDataDTO,@Param("aimDepts") List aimDepts); + + @Select("SELECT a.* from t_device_inspection a LEFT JOIN t_device b on (a.device_id=b.id) where (a.device_type is null or a.device_type!=b.type_id);") + List selectTypeChangeList(); + + @Select("select * from t_device_inspection where state is null and del_flag='0';") + List selectStateNullList(); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionMapper.xml new file mode 100644 index 0000000..2319bf8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/DeviceInspectionMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionLineMapper.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionLineMapper.java new file mode 100644 index 0000000..9ea912b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionLineMapper.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.dailyDuties.dto.InspectionLineDTO; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.dailyDuties.entity.InspectionLine; +import org.security.trans.dailyDuties.vo.InspectionLineVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dailyDuties.vo.InspectionVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 任务-监督检查明细 Mapper 接口 + * + * @author BladeX + * @since 2022-03-25 + */ +public interface InspectionLineMapper extends BaseMapper { + + /** + * 自定义分页 + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectInspectionLinePage(IPage page, @Param("inspectionLineDTO") InspectionLineDTO inspectionLineDTO,@Param("formIdList") List formIdList); + + + /** + * 删除信息 + * @param toLongList 主表关联id + * @return + */ + boolean removeData(@Param("toLongList") List toLongList); + /** + * 根据主表id、相关筛选项查询明细 + * + * @param + * @param inspectionLine + * @return + */ + List selectLinesByInspectionLine(@Param("inspectionLine") InspectionLine inspectionLine); + /** + * 根据主表id查询主表信息 + * + * @param + * @param formId + * @return + */ + List selectRelInspection(String formId); + /** + * 更新主表信息 + * @param inspection 主表信息 + * @return + */ + boolean updateInspection(@Param("inspection")Inspection inspection); + + /** + *数据统计获取子级机构id + */ + List getChildrenDeptId(@Param("aimDeptId") String aimDeptId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionLineMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionLineMapper.xml new file mode 100644 index 0000000..e502aa0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionLineMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update T_INSPECTION_LINE set DEL_FLAG = '1' where 1=1 + + and form_id in + + #{item} + + + + + update T_INSPECTION set status = #{inspection.status},rectify_status=#{inspection.rectifyStatus} where id = #{inspection.id} + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionMapper.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionMapper.java new file mode 100644 index 0000000..ccf5223 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionMapper.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.security.system.user.vo.UserVO; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.dailyDuties.dto.InspectionDTO; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.dailyDuties.vo.InspectionVO; +import org.security.trans.dataStatistics.dto.InspectionDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.InspectionDataVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 任务-监督检查表 Mapper 接口 + * + * @author BladeX + * @since 2022-03-25 + */ +public interface InspectionMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param inspectionDTO + * @return + */ +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectInspectionPage(IPage page, @Param("inspectionDTO") InspectionDTO inspectionDTO,@Param("businessTypeList") List businessTypeList,@Param("aimDepts") List aimDepts); + + /** + * 获取用户名称 + * @param rectifyUser 用户id + * @return + */ + String getUserName(@Param("rectifyUser") String rectifyUser); + + /** + * 获取关联任务信息 + * @param taskId + * @return + */ + String getTaskData(@Param("taskId") String taskId); + + List getAppBacklog(@Param("userId") String userId, @Param("state") String state); + + List getUserByRoleId(@Param("roleId") String roleId,@Param("deptId") String deptId); + + String getDeptData(@Param("deptId") String deptId); + + /** + * 数据统计获取数据 + */ + List getStatisticsData(@Param("inspectionDataDTO") InspectionDataDTO inspectionDataDTO, @Param("aimDepts") List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionMapper.xml new file mode 100644 index 0000000..d61485c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/mapper/InspectionMapper.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IDeviceInspectionLineService.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IDeviceInspectionLineService.java new file mode 100644 index 0000000..6b502c1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IDeviceInspectionLineService.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.service; + +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.common.service.FlowableService; +import org.security.trans.dailyDuties.dto.DeviceInspectionLineDTO; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import org.security.trans.dailyDuties.vo.DeviceInspectionLineVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dailyDuties.vo.DeviceInspectionVO; +import org.security.trans.dailyDuties.vo.DevicePictureVO; +import org.springblade.core.secure.BladeUser; + +import java.util.List; + +/** + * 任务-设备检查明细 服务类 + * + * @author BladeX + * @since 2022-03-25 + */ +public interface IDeviceInspectionLineService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param deviceInspectionLineDTO + * @return + */ + IPage selectDeviceInspectionLinePage(IPage page, DeviceInspectionLineDTO deviceInspectionLineDTO); + + /** + * 获取整改前后图片 + * @param id + * @return + */ + DevicePictureVO getPicture(String id); + + /** + * 获取设备持续整改信息 + * @param user 用户id + * @param stateList 待办对应的状态:待整改状态、已整改状态(但被驳回) + * @param problemStateContinued 持续整改记录标识 + * @return + */ + List getData(BladeUser user, List stateList, String problemStateContinued); + + /** + * 获取持续整改信息 + * @return + */ + List getContinuedRectifyData(List aimDepts); + + DeviceInspectionLineVO getDetailData(String id); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IDeviceInspectionService.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IDeviceInspectionService.java new file mode 100644 index 0000000..2968e5a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IDeviceInspectionService.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.service; + +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.common.service.FlowableService; +import org.security.trans.dailyDuties.dto.DeviceInspectionDTO; +import org.security.trans.dailyDuties.dto.DeviceInspectionLineDTO; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dailyDuties.vo.DeviceInspectionLineVO; +import org.security.trans.dailyDuties.vo.DeviceInspectionVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.DeviceInspectionDataDTO; +import org.security.trans.dataStatistics.vo.DeviceInspectionDataVO; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.tool.api.R; + +import java.util.Date; +import java.util.List; + +/** + * 任务-设备检查表 服务类 + * + * @author BladeX + * @since 2022-03-25 + */ +public interface IDeviceInspectionService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param deviceInspectionDTO + * @return + */ + IPage selectDeviceInspectionPage(IPage page, DeviceInspectionDTO deviceInspectionDTO); + + + Boolean removeDeviceInspectionAndLineByIds(List toLongList); + + R createDeviceInspection(DeviceInspectionDTO deviceInspectionDTO); + + /** + * 获取app待办信息 + * @param user + * @param list + * @return + */ + List getAppBacklog(BladeUser user, List list); + + List getDeviceIns(String deviceId, Date start, Date end); + + List getDeadlineCheckList(); + + DeviceInspectionLineVO changeStateById(DeviceInspectionLineDTO deviceInspectionLineDTO); + + DeviceInspectionVO getData(String id); + + List getAimStatisticsData(DeviceInspectionDataDTO deviceInspectionDataDTO, List aimDepts); + + List getTypeChangeList(); + List getStateNullList(); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IInspectionLineService.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IInspectionLineService.java new file mode 100644 index 0000000..c201ce9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IInspectionLineService.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.service; + +import org.security.trans.common.service.FlowableService; +import org.security.trans.dailyDuties.dto.InspectionLineDTO; +import org.security.trans.dailyDuties.entity.InspectionLine; +import org.security.trans.dailyDuties.vo.InspectionLineVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.web.multipart.MultipartFile; + +import java.text.ParseException; +import java.util.List; + +/** + * 任务-监督检查明细 服务类 + * + * @author BladeX + * @since 2022-03-25 + */ +public interface IInspectionLineService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param inspectionLineDTO + * @return + */ + IPage selectInspectionLinePage(IPage page, InspectionLineDTO inspectionLineDTO); + + /** + * 问题整改 + * @param inspectionLineDTO 检查明细数据 + * @return + * @throws ParseException + */ + Boolean handinRectify(InspectionLineDTO inspectionLineDTO) throws ParseException; + + /** + * 删除信息 + * @param toLongList 主表关联id + * @return + */ + boolean removeData(List toLongList); + + /** + * 导入检查明细 + * @param id 主表记录id + * @param file 文件内容 + * @return + */ + boolean saveData(String id, MultipartFile file); + /** + * 查询检查明细行详情 + * @param id + * @return + */ + InspectionLineVO getDetail(String id); + /** + * 更新检查明细行详情 + * @param inspectionLineDTO + * @return + */ + boolean saveInspectionLine(InspectionLineDTO inspectionLineDTO); + + /** + * 数据统计获取子级机构id + * @param aimDeptId + * @return + */ + List getChildrenDeptId(String aimDeptId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IInspectionService.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IInspectionService.java new file mode 100644 index 0000000..3575a76 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/IInspectionService.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.service; + +import org.security.system.user.vo.UserVO; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.common.service.FlowableService; +import org.security.trans.dailyDuties.dto.InspectionDTO; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.dailyDuties.vo.InspectionVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.InspectionDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.InspectionDataVO; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.tool.api.R; + +import java.text.ParseException; +import java.util.Date; +import java.util.List; + +/** + * 任务-监督检查表 服务类 + * + * @author BladeX + * @since 2022-03-25 + */ +public interface IInspectionService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param inspectionDTO + * @return + */ + IPage selectInspectionPage(IPage page, InspectionDTO inspectionDTO); + + /** + * 问题整改完成 + * @param id 业务数据id + * @return + */ + R changeStateById(String id) throws ParseException; + + /** + * 删除 + * @param toLongList + * @return + */ + Boolean removeInspectionAndLineByIds(List toLongList); + + + /** + * 获取详情信息 + * @param id + * @return + */ + InspectionVO getInspectionData(String id); + + Inspection getCheckInspection(String taskId, String deptId, Date startTime, Date endTime); + + /** + * 新增or修改监督检查信息 + * @param inspection 监督检查信息 + * @return + */ + R saveOrUpdateInspection(InspectionDTO inspection); + + /** + * 提交监督检查信息(检查结果) + * @param inspection 监督检查信息 + * @return + */ + R handin(InspectionDTO inspection); + + List getCheckList(String status); + + /** + * 获取app待办 + * @return + */ + List getAppBacklog(BladeUser user); + + + /** + * 定时任务获取用户信息 + */ + List getUserByRoleId(String roleId,String deptId); + + /** + * 根据部机构id获取机构名称 + * @param deptId + * @return + */ + String getDeptData(String deptId); + + /** + * 数据统计获取本级机构数据 + */ + List getStatisticsData(InspectionDataDTO inspectionDataDTO, List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/DeviceInspectionLineServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/DeviceInspectionLineServiceImpl.java new file mode 100644 index 0000000..a7b1dd4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/DeviceInspectionLineServiceImpl.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.dto.DeviceInspectionLineDTO; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import org.security.trans.dailyDuties.vo.DeviceInspectionLineVO; +import org.security.trans.dailyDuties.mapper.DeviceInspectionLineMapper; +import org.security.trans.dailyDuties.service.IDeviceInspectionLineService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.dailyDuties.vo.DeviceInspectionVO; +import org.security.trans.dailyDuties.vo.DevicePictureVO; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * 任务-设备检查明细 服务实现类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Slf4j +@Service +@AllArgsConstructor +public class DeviceInspectionLineServiceImpl extends ServiceImpl implements IDeviceInspectionLineService { + + private final IFileService fileService; + @Override + public IPage selectDeviceInspectionLinePage(IPage page, DeviceInspectionLineDTO deviceInspectionLineDTO) { + Page queryPage = new Page<>(page.getCurrent(), page.getSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + //获取持续整改记录明细 + if (Constant.PROBLEM_STATE_CONTINUED.equals(deviceInspectionLineDTO.getRectifyFlag())){ + queryWrapper.lambda().eq(DeviceInspectionLine::getId, deviceInspectionLineDTO.getFormId()); + }//获取非持续整改记录明细 + if (Constant.PROBLEM_STATE_USUUAL.equals(deviceInspectionLineDTO.getRectifyFlag())){ + queryWrapper.lambda().eq(DeviceInspectionLine::getFormId, deviceInspectionLineDTO.getFormId()) + .eq(DeviceInspectionLine::getRecFlag,Constant.PROBLEM_STATE_USUUAL); + } + //设备检查数据 + if("3".equals(deviceInspectionLineDTO.getRectifyFlag())){ + queryWrapper.lambda().eq(DeviceInspectionLine::getFormId, deviceInspectionLineDTO.getFormId()); + } + Page resultPage = this.page(queryPage, queryWrapper); + List records = resultPage.getRecords(); + List deviceInspectionLineVOList = Func.copy(records, DeviceInspectionLineVO.class); + return new Page(). + setCurrent(resultPage.getCurrent()) + .setTotal(resultPage.getTotal()) + .setSize(resultPage.getSize()) + .setRecords(deviceInspectionLineVOList); + } + + + @Override + public DevicePictureVO getPicture(String id) { + DeviceInspectionLine deviceInspectionLine = this.getById(id); + DevicePictureVO pictureVO = Func.copy(deviceInspectionLine,DevicePictureVO.class); + //整改前图片 + pictureVO.setBeforePicList(fileService.getAttachments(deviceInspectionLine.getId(),deviceInspectionLine.getBeforePicIds())); + //整改后图片 + pictureVO.setAfterPicList(fileService.getAttachments(deviceInspectionLine.getId(),deviceInspectionLine.getAfterPicIds())); + return pictureVO; + } + //获取设备持续整改待办 + @Override + public List getData(BladeUser user, List stateList, String problemStateContinued) { + return baseMapper.getData(String.valueOf(user.getDeptId()),stateList,problemStateContinued); + } + + @Override + public List getContinuedRectifyData(List aimDepts) { + List vos = new ArrayList<>(); + List deviceInspectionLineList = baseMapper.getContinuedRectifyData(aimDepts); + if (Func.isNotEmpty(deviceInspectionLineList)){ + deviceInspectionLineList.forEach(item -> { + DeviceInspection deviceInspection = baseMapper.getDeviceInspection(item.getFormId()); + DeviceInspectionVO inspectionVO = Func.copy(deviceInspection, DeviceInspectionVO.class); + inspectionVO.setId(item.getId()); + inspectionVO.setStatus(item.getStatus()); + inspectionVO.setRectifyFlag(Constant.PROBLEM_STATE_CONTINUED); + vos.add(inspectionVO); + }); + } + return vos; + } + + @Override + public DeviceInspectionLineVO getDetailData(String id) { + DeviceInspectionLine deviceInspectionLine = this.getById(id); + DeviceInspectionLineVO vo = Func.copy(deviceInspectionLine, DeviceInspectionLineVO.class); + vo.setBeforeImages(fileService.getAttachments(deviceInspectionLine.getId(),deviceInspectionLine.getBeforePicIds())); + vo.setAfterImages(fileService.getAttachments(deviceInspectionLine.getId(),deviceInspectionLine.getAfterPicIds())); + return vo; + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public R afterFlowFinished(String id, Boolean pass, Map variables) { + Boolean result = false; + String state; + if (null == pass) { + state = ProcessConstant.CANCEL_STATE; + } else if (pass) { + state = ProcessConstant.PASS_STATE; + } else { + state = ProcessConstant.REJECT_STATE; + } + result = this.updateStateById(id, state); + if (result) { + DeviceInspectionLine deviceInspectionLine = this.getOne(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(id), DeviceInspectionLine::getId, id)); + if (Func.isNotEmpty(deviceInspectionLine)) { + if (Func.isNotEmpty(pass) && pass) { + //本条持续整改记录如果整改结果为异常,需再次生成持续整改待办任务 + if (Constant.DEVICE_PROBLEM_WARN.equals(deviceInspectionLine.getRectificationStatus())){ + log.info("==============设备持续整改仍为异常,继续持续整改=============="); +// 查出同一个formId、同一检查项、等待确认的明细记录,将最新一条(考虑多次提交驳回会产生多条记录)的状态置为待整改 + List continueTodoLists = this.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(deviceInspectionLine.getFormId()), DeviceInspectionLine::getFormId, deviceInspectionLine.getFormId()) + .eq(Func.isNotEmpty(deviceInspectionLine.getName()), DeviceInspectionLine::getName, deviceInspectionLine.getName()) + .eq(DeviceInspectionLine::getStatus, Constant.DEVICE_STATE_LEADER_CONFIRM) + .eq(DeviceInspectionLine::getDelFlag,Constant.DELETE_FLAG_0) + .orderByDesc(DeviceInspectionLine::getCreatedTime)); + if(continueTodoLists.size()>0){ + result = this.update(new UpdateWrapper().lambda().set(DeviceInspectionLine::getStatus, Constant.DEVICE_STATE_RECTIFY).eq(DeviceInspectionLine::getId, continueTodoLists.get(0).getId())); + } + } +// if (Constant.DEVICE_STATE_LEADER_CONFIRM.equals(deviceInspectionLine.getStatus())){ +// result = this.update(new UpdateWrapper().lambda().set(DeviceInspectionLine::getStatus, Constant.DEVICE_STATE_RECTIFY).eq(DeviceInspectionLine::getId, deviceInspectionLine.getId())); +// } + //本条持续整改记录提报,审批通过之后状态置为‘已整改’(提交时就被置为了已整改,因此此处不会调用,后续改为审批完成再来更改状态) +// if (Constant.PROBLEM_STATE_DRAFT_ONE.equals(deviceInspectionLine.getStatus())){ +// result = this.update(new UpdateWrapper().lambda().set(DeviceInspectionLine::getStatus,Constant.DEVICE_STATE_RECTIFY_OVER).eq(DeviceInspectionLine::getId, deviceInspectionLine.getId())); +// } + } + if (!result){ + log.error("审批更新业务表单失败"); + return R.fail("审批更新业务表单失败"); + } + + } + } + return R.success("执行成功"); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/DeviceInspectionServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/DeviceInspectionServiceImpl.java new file mode 100644 index 0000000..8f569f4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/DeviceInspectionServiceImpl.java @@ -0,0 +1,412 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.trans.app.vo.BacklogVO; +import org.security.ht.entity.basic.Department; +import org.security.ht.entity.basic.Device; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.basic.service.IDeviceService; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.dto.DeviceInspectionDTO; +import org.security.trans.dailyDuties.dto.DeviceInspectionLineDTO; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import org.security.trans.dailyDuties.mapper.DeviceInspectionMapper; +import org.security.trans.dailyDuties.service.IDeviceInspectionLineService; +import org.security.trans.dailyDuties.service.IDeviceInspectionService; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.dailyDuties.vo.DeviceInspectionLineVO; +import org.security.trans.dailyDuties.vo.DeviceInspectionVO; +import org.security.trans.dataStatistics.dto.DeviceInspectionDataDTO; +import org.security.trans.dataStatistics.service.impl.InspectionDataServiceImpl; +import org.security.trans.dataStatistics.vo.DeviceInspectionDataVO; +import org.security.trans.settings.entity.DeviceInspectionSettings; +import org.security.trans.settings.service.IDeviceInspectionSettingsService; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +import static org.security.common.Constant.*; + +/** + * 任务-设备检查表 服务实现类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Slf4j +@Service +@AllArgsConstructor +public class DeviceInspectionServiceImpl extends ServiceImpl implements IDeviceInspectionService { + private final IDeviceInspectionLineService deviceInspectionLineService; + private final IDeviceService deviceService; + private final IDeviceInspectionSettingsService deviceInspectionSettingsService; + private final IDepartmentService departmentService; + private final IFileService fileService; + private final IInspectionService iInspectionService; + private final InspectionDataServiceImpl inspectionDataService; + + @Override + public IPage selectDeviceInspectionPage(IPage page, DeviceInspectionDTO deviceInspectionDTO) { + List aimDepts = inspectionDataService.setDeptIds(deviceInspectionDTO.getDeptId(), deviceInspectionDTO.getIncludeChildren()); +// String deptId = null; +// if (StringUtils.isNotBlank(deviceInspectionDTO.getDeptId())) { +// List strList = Func.toStrList(deviceInspectionDTO.getDeptId()); +// deptId = strList.get(strList.size() - 1); +// } + Page queryPage = new Page<>(page.getCurrent(), page.getSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda() + .eq(DeviceInspection::getDelFlag, DELETE_FLAG_0) +// .eq(StringUtils.isNotBlank(deptId), DeviceInspection::getDeptId, deptId) + .in(Func.isNotEmpty(aimDepts), DeviceInspection::getDeptId, aimDepts) + .eq(StringUtils.isNotBlank(deviceInspectionDTO.getDeviceId()), DeviceInspection::getDeviceId, deviceInspectionDTO.getDeviceId()) + .eq(StringUtils.isNotBlank(deviceInspectionDTO.getDeviceType()), DeviceInspection::getDeviceType, deviceInspectionDTO.getDeviceType()) + .eq(StringUtils.isNotBlank(deviceInspectionDTO.getStatus()), DeviceInspection::getStatus, deviceInspectionDTO.getStatus()) + .like(StringUtils.isNotBlank(deviceInspectionDTO.getDeviceName()), DeviceInspection::getDeviceName, deviceInspectionDTO.getDeviceName()) + .like(StringUtils.isNotBlank(deviceInspectionDTO.getDeviceNum()), DeviceInspection::getDeviceNum, deviceInspectionDTO.getDeviceNum()) + .ge(Func.isNotEmpty(deviceInspectionDTO.getInspectTimeBegin()), DeviceInspection::getInspectTime, deviceInspectionDTO.getInspectTimeBegin())//检查时间大于等于InspectTimeBegin + .le(Func.isNotEmpty(deviceInspectionDTO.getInspectTimeEnd()), DeviceInspection::getInspectTime, deviceInspectionDTO.getInspectTimeEnd())//检查时间小于等于InspectTimeEnd + .orderByDesc(DeviceInspection::getCreatedTime); + IPage resultPage = this.baseMapper.selectDeviceInspectionPage(queryPage, queryWrapper); + log.info("===resultPage:【{}】===",resultPage); + List records = resultPage.getRecords(); + log.info("===records:【{}】===",records); + List deviceInspectionVOList = Func.copy(records, DeviceInspectionVO.class); + //获取设备持续整改记录 +// List continuedRectifyList = deviceInspectionLineService.getContinuedRectifyData(aimDepts); +// deviceInspectionVOList.addAll(continuedRectifyList); + if (Func.isNotEmpty(deviceInspectionVOList)){ + deviceInspectionVOList.forEach(item ->{ + if (Func.isEmpty(item.getRectifyFlag()) && (Constant.DEVICE_STATE_INSPECTION.equals(item.getStatus()) || Constant.DEVICE_STATE_INSPECTION_OVER.equals(item.getStatus()) || Constant.DEVICE_STATE_OVERTIME_INSPECTION.equals(item.getStatus()))){ + item.setRectifyFlag("3"); + } + if (Func.isEmpty(item.getRectifyFlag()) && (Constant.DEVICE_STATE_RECTIFY.equals(item.getStatus()) || Constant.DEVICE_STATE_RECTIFY_OVER.equals(item.getStatus()))){ + item.setRectifyFlag(Constant.PROBLEM_STATE_USUUAL); + } + //检查负责部门 + if(Func.isNotEmpty(item.getDeptId())){ + Department department = departmentService.getById(item.getDeptId()); + item.setDepName(Func.isNotEmpty(department) ? department.getDeptName() : null); + } + //设备所属部门 + Department department2 = departmentService.getById(deviceService.getById(item.getDeviceId()).getDepId()); + item.setDeptName(Func.isNotEmpty(department2) ? department2.getDeptName() : null); + //创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + //更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + //检查人名称 + item.setInspectUserName(fileService.getUserNameById(item.getInspectUser())); + //整改人名称 + item.setRectifyUserName(fileService.getUserNameById(item.getRectifyUser())); + }); + } + return new Page() + .setRecords(deviceInspectionVOList) + .setSize(resultPage.getSize()) + .setTotal(resultPage.getTotal()) + .setCurrent(resultPage.getCurrent()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean removeDeviceInspectionAndLineByIds(List toLongList) { +// List ids = Func.copy(toLongList, String.class); + toLongList.forEach(formId -> { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DeviceInspectionLine::getFormId, String.valueOf(formId)); + deviceInspectionLineService.remove(queryWrapper); + }); + return this.removeByIds(toLongList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R createDeviceInspection(DeviceInspectionDTO deviceInspectionDTO) { + log.info("==============发起设备检查=============="); + //获取需要检查的设备id + List ids = Func.toStrList(deviceInspectionDTO.getIds()); + //获取需要检查的设备信息 + List deviceList = deviceService.list(new QueryWrapper().lambda().in(Func.isNotEmpty(ids),Device::getId,ids)); + List deviceInspectionLineList = new ArrayList<>(); + log.info("需要检查的设备个数[{}]" , deviceList.size()); + List deviceInspectionIds = new ArrayList<>(); + if (Func.isNotEmpty(deviceList)) { + //设备信息赋值给设备检查实体 + deviceList.forEach(item -> { + //更新设备表中的设备状态 +// updateDeviceState(item); + //创建设备检查记录 + DeviceInspection deviceInspection = saveDeviceInspection(deviceInspectionDTO, item); + deviceInspectionIds.add(deviceInspection.getId()); + //获取设备的类型层级 + getOriDeviceLevel(deviceInspectionLineList, item, deviceInspection); + }); + } + if(deviceInspectionLineList.size()>0){ + deviceInspectionLineService.saveBatch(deviceInspectionLineList); + return R.data(deviceInspectionIds) ; + } + log.info("==============发起设备检查结束=============="); + return R.data(deviceInspectionIds); + } + + /** + * 获取设备的类型层级 + */ + private void getOriDeviceLevel(List deviceInspectionLineList, Device item, DeviceInspection deviceInspection) { + List typeIds = Func.toStrList(item.getTypeRank()); + List itemInspectionLineList = new ArrayList<>();//记录仅当前设备的检查项 + //根据设备类型层级,循环查询设备检查项表 + typeIds.forEach(typeId -> { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DeviceInspectionSettings::getDeviceCatgId, typeId); + //获取设备检查项 + List settingsList = deviceInspectionSettingsService.list(queryWrapper); + if(settingsList.size()>0){ + settingsList.forEach(setting -> { + DeviceInspectionLine deviceInspectionLine = new DeviceInspectionLine(); + deviceInspectionLine.setFormId(deviceInspection.getId()); + deviceInspectionLine.setName(setting.getName()); + deviceInspectionLine.setDeviceState(DEVICE_LINE_STATE_0); + deviceInspectionLine.setStatus(Constant.DEVICE_STATE_INSPECTION); + deviceInspectionLine.setState(Constant.HANDIN_STATE_DRAFT); + deviceInspectionLine.setDeptId(deviceInspection.getDeptId()); + deviceInspectionLine.setDeptName(deviceInspection.getDeptName()); + deviceInspectionLine.setProblemLevel(Constant.DEVICE_PROBLEM_NORMAL);//设备检查的各检查项项默认检查结果为:1-正常 + itemInspectionLineList.add(deviceInspectionLine); + deviceInspectionLineList.add(deviceInspectionLine); + }); + } + }); + if(itemInspectionLineList.size()<1){ + log.info("-----当前设备【{}-{}】无法查询到对应的设备检查项",item.getName(),item.getId()); + throw new ServiceException(StringUtil.format("设备【{}-{}】无法查询到对应的设备检查项", item.getName(),item.getDeviceNum())); + } + } + + /** + *创建设备检查记录 + */ + private DeviceInspection saveDeviceInspection(DeviceInspectionDTO deviceInspectionDTO, Device item) { + DeviceInspection deviceInspection = new DeviceInspection(); + deviceInspection.setDeviceId(item.getId()); + deviceInspection.setDeviceType(item.getTypeId());//设备类型 + deviceInspection.setDeviceNum(item.getDeviceNum());//设备编号 + deviceInspection.setDeviceName(item.getName()); + deviceInspection.setDeviceModelNum(item.getModelNum()); + deviceInspection.setState(Constant.HANDIN_STATE_DRAFT); + deviceInspection.setInspectUser(deviceInspectionDTO.getInspectUser()); + deviceInspection.setAuditUser(deviceInspectionDTO.getAuditUser()); + //检查发起部门 + deviceInspection.setCreateDeptId(AuthUtil.getDeptId()); + //所属部门 + deviceInspection.setDeptId(item.getDepId()); + deviceInspection.setDeptName(departmentService.getById(deviceInspection.getDeptId()).getDeptName()); + deviceInspection.setStatus(Constant.DEVICE_STATE_INSPECTION); + deviceInspection.setCheckDeadline(deviceInspectionDTO.getCheckDeadline()); + this.save(deviceInspection); + return deviceInspection; + } + + /** + *更新设备表中的设备状态 + */ + private void updateDeviceState(Device item) { + //存放原状态 + item.setOrgState(item.getState()); + //把设备状态设为检查中并更新设备表 + item.setState(DEVICE_STATE_INSPECTION); + deviceService.updateById(item); + } + + @Override + public List getDeviceIns(String deviceId, Date start, Date end) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("DEVICE_ID", deviceId); + queryWrapper.ge("CREATED_TIME", start); + queryWrapper.le("CREATED_TIME", end); + return baseMapper.selectList(queryWrapper); + } + + @Override + public List getAppBacklog(BladeUser user, List list) { + log.info("========getAppBacklog user:{}",user); + log.info("========getAppBacklog list:{}",list); + return baseMapper.getAppBacklog(String.valueOf(user.getDeptId()), list); + } + + @Override + public List getDeadlineCheckList() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("STATUS", Constant.DEVICE_STATE_INSPECTION); + queryWrapper.eq("DEL_FLAG",Constant.DELETE_FLAG_0); + return baseMapper.selectList(queryWrapper); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DeviceInspectionLineVO changeStateById(DeviceInspectionLineDTO deviceInspectionLineDTO) { + DeviceInspectionLineVO vo = new DeviceInspectionLineVO(); + List idList = Func.toStrList(deviceInspectionLineDTO.getIds()); + List deviceInspectionLineList = deviceInspectionLineService.listByIds(idList); + deviceInspectionLineList.forEach(item -> item.setDeviceState(DEVICE_LINE_STATE_2)); + deviceInspectionLineService.updateBatchById(deviceInspectionLineList); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DeviceInspectionLine::getFormId, deviceInspectionLineDTO.getFormId()); + List updateAfterList = deviceInspectionLineService.list(queryWrapper); + int count = 0; + for (DeviceInspectionLine deviceInspectionLine : updateAfterList) { + if (DEVICE_LINE_STATE_2.equals(deviceInspectionLine.getDeviceState())) { + count++; + } + } + if (count == updateAfterList.size()) { //判断设备的检查项是否都检查完成 + //查询设备检查主表 + QueryWrapper inspectionQueryWrapper = new QueryWrapper<>(); + inspectionQueryWrapper.lambda().eq(DeviceInspection::getId, deviceInspectionLineDTO.getFormId()); + DeviceInspection deviceInspection = this.getOne(inspectionQueryWrapper); + deviceInspection.setStatus(DEVICE_STATE_INSPECTION_OVER); + //查询设备表 + QueryWrapper deviceQueryWrapper = new QueryWrapper<>(); + deviceQueryWrapper.lambda().eq(Device::getId, deviceInspection.getDeviceId()); + Device device = deviceService.getOne(deviceQueryWrapper); + device.setState(device.getOrgState()); //检查完成,还原设备状态 + device.setOrgState(""); + this.updateById(deviceInspection);//更新设备检查表主表 + deviceService.updateById(device);//更新设备表 + vo.setOverFlag(true); + } + vo.setOverFlag(false); + return vo; + } + + @Override + public DeviceInspectionVO getData(String id) { + DeviceInspection deviceInspection = this.getById(id); + DeviceInspectionVO inspectionVO = Func.copy(deviceInspection, DeviceInspectionVO.class); + inspectionVO.setDepName(iInspectionService.getDeptData(deviceInspection.getDeptId())); + inspectionVO.setInspectUserName(fileService.getUserNameById(inspectionVO.getInspectUser()));//检查人 + inspectionVO.setRectifyUserName(fileService.getUserNameById(inspectionVO.getRectifyUser()));//整改人 + //获取设备检查相关明细 + List list = deviceInspectionLineService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(id), DeviceInspectionLine::getFormId, id) +// .ne(DeviceInspectionLine::getRecFlag,Constant.PROBLEM_STATE_CONTINUED)); + .ne(DeviceInspectionLine::getStatus,Constant.DEVICE_STATE_LEADER_CONFIRM));//除了9-待领导确认状态(对用户来说还没有生成的持续整改明细),其他状态的可查出 + if (Func.isNotEmpty(list)) { + List inspectionLineList = Func.copy(list, DeviceInspectionLineVO.class); + inspectionLineList.forEach(item -> { + //获取整改前图片 + item.setBeforeImages(fileService.getAttachments(item.getId(),item.getBeforePicIds())); + //获取整改后图片 + item.setBeforeImages(fileService.getAttachments(item.getId(),item.getAfterPicIds())); + }); + inspectionVO.setDeviceInspectionLines(inspectionLineList); + } + + return inspectionVO; + } + + @Override + public List getAimStatisticsData(DeviceInspectionDataDTO deviceInspectionDataDTO, List aimDepts) { + return baseMapper.getAimStatisticsData(deviceInspectionDataDTO,aimDepts); + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public R afterFlowFinished(String id, Boolean pass, Map variables) { + Boolean result = false; + String state; + if (null == pass) { + state = ProcessConstant.CANCEL_STATE; + } else if (pass) { + state = ProcessConstant.PASS_STATE; + } else { + state = ProcessConstant.REJECT_STATE; + } + result = this.updateStateById(id, state); + if (result) { + DeviceInspection deviceInspection = this.getById(id); + //筛选出持续整改记录 + List list = deviceInspectionLineService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(id), DeviceInspectionLine::getFormId, id)); + List collect = new ArrayList<>(); + if (Func.isNotEmpty(list)){ + collect = list.stream().filter(item -> Constant.PROBLEM_STATE_CONTINUED.equals(item.getRecFlag()) + && Constant.DEVICE_STATE_LEADER_CONFIRM.equals(item.getStatus())).map(DeviceInspectionLine::getId).collect(Collectors.toList()); + } + //审批通过 + log.info("----------------------------持续整改记录的id[{}]-----------------------------",collect); + if (Func.isNotEmpty(pass) && pass) { + //设备检查无异常审批通过 + if (Constant.DEVICE_STATE_INSPECTION.equals(deviceInspection.getStatus())) { + log.info("设备检查审批通过"); + deviceInspection.setStatus(Constant.DEVICE_STATE_INSPECTION_OVER); + } + //设备整改提报审批通过 + if (Constant.DEVICE_STATE_RECTIFY.equals(deviceInspection.getStatus())) { + log.info("设备整改审批通过"); + deviceInspection.setStatus(Constant.DEVICE_STATE_RECTIFY_OVER); + } + //审批通过变更持续整改记录状态为待整改 + if (Func.isNotEmpty(collect)){ + log.info("设备持续整改明细[{}]",collect); + deviceInspectionLineService.update(new UpdateWrapper().lambda().set(DeviceInspectionLine::getStatus, Constant.DEVICE_STATE_RECTIFY).in(DeviceInspectionLine::getId, collect)); + } + }else { + if (Constant.DEVICE_STATE_RECTIFY.equals(deviceInspection.getStatus())) { + deviceInspection.setStatus(Constant.DEVICE_STATE_RECTIFY); + } + //审批拒绝或撤回,若审批记录明细存在持续整改申请记录,删除该明细 + if (Func.isNotEmpty(collect)){ + deviceInspectionLineService.removeByIds(collect); + } + } + this.updateById(deviceInspection); + } + return R.success("执行成功"); + } + + @Override + public List getTypeChangeList() { + return baseMapper.selectTypeChangeList(); + } + + @Override + public List getStateNullList() { + return baseMapper.selectStateNullList(); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/InspectionLineServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/InspectionLineServiceImpl.java new file mode 100644 index 0000000..0075408 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/InspectionLineServiceImpl.java @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.service.impl; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.eum.OtherDataEnum; +import org.security.common.util.DataFormatUtil; +import org.security.common.util.ExcelUtil; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.ht.vo.common.UploadVO; +import org.security.system.feign.ISysClient; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.dto.InspectionLineDTO; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.dailyDuties.entity.InspectionLine; +import org.security.trans.dailyDuties.dto.InspectionLineExcelDTO; +import org.security.trans.dailyDuties.vo.InspectionLineVO; +import org.security.trans.dailyDuties.mapper.InspectionLineMapper; +import org.security.trans.dailyDuties.service.IInspectionLineService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.dailyDuties.vo.InspectionVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +import static org.security.common.Constant.*; + +/** + * 任务-监督检查明细 服务实现类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Slf4j +@Service +@AllArgsConstructor +public class InspectionLineServiceImpl extends ServiceImpl implements IInspectionLineService { + private final IFlowClient flowClient; + private final ISysClient sysClient; + private final IFileService fileService; + + @Override + public boolean saveInspectionLine(InspectionLineDTO inspectionLineDTO) { + inspectionLineDTO.setStatus("1".equals(inspectionLineDTO.getHasProblem()) ? PROBLEM_STATE_WAIT_RECTIFY : PROBLEM_STATE_NO_PROBLEM); + super.saveOrUpdate(inspectionLineDTO); + List fileList = inspectionLineDTO.getCheckPicList(); + List fileList2 = inspectionLineDTO.getRectifyPicList(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, inspectionLineDTO.getId()); + } + if (Objects.nonNull(fileList2) && !fileList2.isEmpty()) { + fileService.saveAttachments(fileList2, inspectionLineDTO.getId()); + } + return true; + } + + + @Override + public List getChildrenDeptId(String aimDeptId) { + return baseMapper.getChildrenDeptId(aimDeptId); + } + + @Override + public IPage selectInspectionLinePage(IPage page, InspectionLineDTO inspectionLineDTO) { + List formIdList = Func.toStrList(inspectionLineDTO.getFormIds()); + log.info("=======formIdList========{}", formIdList); + List res = baseMapper.selectInspectionLinePage(page, inspectionLineDTO, formIdList); + if(Func.isNotEmpty(res)){ + res.forEach(item->{ + //创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + //更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + return page.setRecords(res); + } + + /** + * 提交明细的整改结果,更新整改状态 + * + * @param inspectionLineDTO 检查明细数据 + * @return + * @throws ParseException + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean handinRectify(InspectionLineDTO inspectionLineDTO) throws ParseException { + InspectionLine inspectionLine = Func.copy(inspectionLineDTO, InspectionLine.class); +// if ("1".equals(inspectionLine.getNeedContinue())) {// 需要持续整改 +// InspectionLine nLine = Func.copy(inspectionLine, InspectionLine.class); +// nLine.setId(null); +// nLine.setRectifyDescribe(""); +// nLine.setFlag("2"); +// nLine.setNeedContinue("0"); +// nLine.setStatus(PROBLEM_STATE_WAIT_RECTIFY); +// nLine.setState(HANDIN_STATE_DRAFT); +// nLine.setRectifyDeadline(inspectionLineDTO.getNewDeadline()); +// this.saveOrUpdate(nLine);//新增一条对应的待整改明细 +// //存储整改后附件 +// fileService.saveAttachments(inspectionLineDTO.getRectifyPicList(),inspectionLine.getId()); +// } + this.updateById(inspectionLine); + //存储整改后附件 + fileService.saveAttachments(inspectionLineDTO.getRectifyPicList(),inspectionLine.getId()); + // 挂载流程 + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.INSPECTION_LINE_KEY); + if (definitionRes.isSuccess()) { + inspectionLine.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("未查询到流程定义,开启流程失败"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + String businessTable = FlowUtil.getBusinessTable(InspectionLine.class); +// 查询主表inspection的信息,用于获取检查方、检查类型信息------ + List res = baseMapper.selectRelInspection(inspectionLineDTO.getFormId()); + String flowCheckType = "inside"; + R sendDeptCategory = R.data(1); + if (Func.isNotEmpty(res)) { + Inspection inspection = Func.copy(res.get(0), Inspection.class); + if ("3".equals(inspection.getCheckType())) { + flowCheckType = "outside"; + } else { + sendDeptCategory = sysClient.getDeptCategory(Long.valueOf(inspection.getInspectDep())); + if (!sendDeptCategory.isSuccess()) { + throw new ServiceException("查询检查方部门类型失败,请检查后再试!"); + } + } + } + + // 行内检查或外部检查(行内检查:inside,外部检查:outside)、检查方类型(总行:1,分行:2) + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, inspectionLine.getId()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()) + .set("checkType", flowCheckType) + .set("sendDeptCategory", sendDeptCategory.getData()); + R result = flowClient.startProcessInstanceById(inspectionLine.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(inspectionLine.getId())), variables); + if (result.isSuccess()) { + inspectionLine.setRectifyDate(DataFormatUtil.getNowDate()); + inspectionLine.setState(HANDIN_STATE_AUDIT); + // 业务状态:根据整改期限及当前日期判断是否超时整改 + inspectionLine.setStatus(inspectionLine.getRectifyDeadline().before(DataFormatUtil.getLocalDate()) ? PROBLEM_STATE_OVERTIME_SUBMIT : PROBLEM_STATE_SUBMIT); + inspectionLine.setProcessInstanceId(result.getData().getProcessInstanceId()); + + } else { + throw new ServiceException("开启流程失败"); + } + this.updateById(inspectionLine); + if ("1".equals(inspectionLine.getFlag())) { + updateInspection(inspectionLine); + } + return true; + } + + /** + *检查相关的主表状态,更新主表状态 + * @param inspectionLine + */ + private void updateInspection(InspectionLine inspectionLine) { + Inspection inspection = baseMapper.selectRelInspection(inspectionLine.getFormId()).get(0); + // 查出此条检查明细所属主表的所有一般整改明细(不考虑持续整改明细) + List res2 = baseMapper.selectLinesByInspectionLine(inspectionLine); + if (Func.isNotEmpty(res2)) { + //待整改的 + List collect1 = res2.stream().filter(item -> PROBLEM_STATE_WAIT_RECTIFY.equals(item.getStatus())).collect(Collectors.toList()); + int waitRectify = collect1.size(); + //超期待整改的 + List collect2 = res2.stream().filter(item -> PROBLEM_STATE_OVERTIME.equals(item.getStatus())).collect(Collectors.toList()); + int overTimeRectify = collect2.size(); + //超期完成整改的 + List collect3 = res2.stream().filter(item -> PROBLEM_STATE_OVERTIME_SUBMIT.equals(item.getStatus())).collect(Collectors.toList()); + int overtimeDoneRectify = collect3.size(); + + if (overTimeRectify > 0) { + inspection.setStatus(PROBLEM_STATE_OVERTIME); + } else if (waitRectify > 0) { + inspection.setStatus(PROBLEM_STATE_WAIT_RECTIFY); + } else if (overtimeDoneRectify > 0) { + inspection.setStatus(PROBLEM_STATE_OVERTIME_SUBMIT); + inspection.setRectifyStatus("1"); + } else { + inspection.setStatus(PROBLEM_STATE_SUBMIT); + inspection.setRectifyStatus("1"); + } + baseMapper.updateInspection(inspection); + } + } + + /** + * 删除信息 + * + * @param toLongList 主表关联id + * @return + */ + @Override + public boolean removeData(List toLongList) { + return baseMapper.removeData(toLongList); + } + + /** + * 导入检查结果明细 + * + * @param id 主表记录id + * @param file 文件内容 + * @return + */ + @Override + public boolean saveData(String id, MultipartFile file) { + ArrayList lines = new ArrayList<>(); + //读取excel文件内容 + List list = ExcelUtil.read(file, InspectionLineExcelDTO.class); + if (Func.isNotEmpty(list)) { + list.forEach(item -> { + InspectionLine inspectionLine = Func.copy(item, InspectionLine.class); + inspectionLine.setDescription(Func.isBlank(item.getDescription()) ? "" : item.getDescription()); + inspectionLine.setFormId(id); + inspectionLine.setHasProblem(OtherDataEnum.parseByLabel(inspectionLine.getHasProblem()).getCode()); + inspectionLine.setState(HANDIN_STATE_DRAFT); + inspectionLine.setStatus("1".equals(inspectionLine.getHasProblem()) ? PROBLEM_STATE_WAIT_RECTIFY : PROBLEM_STATE_NO_PROBLEM); + lines.add(inspectionLine); + }); + } + return this.saveBatch(lines); + } + + @Override + public InspectionLineVO getDetail(String id) { + InspectionLine detail = super.getById(id); + InspectionLineVO inspectionLineVO = Func.copy(detail, InspectionLineVO.class); + //整改前图片 + inspectionLineVO.setCheckPicList(fileService.getAttachments(detail.getId(), detail.getCheckPic())); + //整改后图片 + inspectionLineVO.setRectifyPicList(fileService.getAttachments(detail.getId(), detail.getRectifyPic())); + return inspectionLineVO; + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public R afterFlowFinished(String id, Boolean pass, Map var) { + Boolean result = false; + String state; + if (null == pass) { + state = ProcessConstant.CANCEL_STATE; + } else if (pass) { + state = ProcessConstant.PASS_STATE; + } else { + state = ProcessConstant.REJECT_STATE; + } + result = this.updateStateById(id, state); + if (result){ + InspectionLine inspectionLine = this.getById(id); + //审批通过持续整改记录创建 + if ("1".equals(inspectionLine.getNeedContinue()) && Func.isNotEmpty(pass)){ + InspectionLine line = Func.copy(inspectionLine, InspectionLine.class); + line.setFlag(Constant.PROBLEM_STATE_CONTINUED); + line.setState(Constant.HANDIN_STATE_DRAFT); + line.setStatus(Constant.PROBLEM_STATE_WAIT_RECTIFY); + line.setId(null); + line.setNeedContinue("0"); + line.setRectifyDeadline(inspectionLine.getNewDeadline()); + line.setRectifyDescribe(""); + this.save(line); + //获取附件 + List checkPics = fileService.getAttachments(inspectionLine.getId(), inspectionLine.getCheckPic()); + List rectifyPics = fileService.getAttachments(inspectionLine.getId(), inspectionLine.getRectifyPic()); + //保存相关附件 + fileService.saveAttachments(checkPics,line.getId()); + fileService.saveAttachments(rectifyPics,line.getId()); + } + + } + return R.status(result); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/InspectionServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/InspectionServiceImpl.java new file mode 100644 index 0000000..d0611dc --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/service/impl/InspectionServiceImpl.java @@ -0,0 +1,388 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.util.DataFormatUtil; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.feign.ISysClient; +import org.security.system.user.vo.UserVO; +import org.security.trans.app.vo.BacklogVO; +import org.security.ht.entity.basic.Department; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.dto.InspectionDTO; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.dailyDuties.entity.InspectionLine; +import org.security.trans.dailyDuties.mapper.InspectionMapper; +import org.security.trans.dailyDuties.service.IInspectionLineService; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.dailyDuties.vo.InspectionVO; +import org.security.trans.dataStatistics.dto.InspectionDataDTO; +import org.security.trans.dataStatistics.service.impl.InspectionDataServiceImpl; +import org.security.trans.dataStatistics.vo.InspectionDataVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +import static org.security.common.Constant.*; + +/** + * 任务-监督检查表 服务实现类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Slf4j +@Service +@AllArgsConstructor +public class InspectionServiceImpl extends ServiceImpl implements IInspectionService { + private final IInspectionLineService inspectionLineService; + private final IDepartmentService departmentService; + private final IFlowClient flowClient; + private final ISysClient sysClient; + private final IFileService fileService; + + @Override + public IPage selectInspectionPage(IPage page, InspectionDTO inspectionDTO) { + List aimDepts = fileService.setDeptIds(inspectionDTO.getDeptId(), inspectionDTO.getIncludeChildren()); + //获取模块标识符List + List businessTypeList = Func.toStrList(inspectionDTO.getBizTypeStr()); + List vos = baseMapper.selectInspectionPage(page, inspectionDTO, businessTypeList,aimDepts); + //根据机构id和用户id获取对应name值 + vos.forEach(this::setReturnResult); + return page.setRecords(vos); + } + + /** + * 处理返回对象,根据id获取对应name值 + */ + private void setReturnResult(InspectionVO item) { + //提报机构 + if (Func.isNotEmpty(item.getDeptId())) { + item.setDeptName(departmentService.getById(item.getDeptId()).getDeptName()); + } + //检查机构 + if (INSPECTION_TYPE_OUT.equals(item.getCheckType())) { + //检查机构为外部机构,直接赋值 + item.setInspectDepName(item.getInspectDep()); + }else if(!(INSPECTION_TYPE_OUT.equals(item.getCheckType()))){ + //检查机构为内部机构,从机构表里查出机构名 + item.setInspectDepName(departmentService.getById(item.getInspectDep()).getDeptName()); + } + //被检查机构 + item.setInspectedDepName(departmentService.getById(item.getInspectedDep()).getDeptName()); + //整改责任人 + if (Func.isNotEmpty(item.getRectifyUser())) { + item.setRectifyUserName(baseMapper.getUserName(item.getRectifyUser())); + } + //关联任务 + if (Func.isNotEmpty(item.getTaskId())) { + item.setTaskName(baseMapper.getTaskData(item.getTaskId())); + } + //创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + //更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + } + + /** + * 提交整改结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public R changeStateById(String id) throws ParseException { + log.info("==============[提交整改结果]开始=============="); + Inspection inspection = this.getById(id); + //发起审批流程 + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.INSPECTION_KEY); + if (definitionRes.isSuccess()) { + inspection.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + String businessTable = FlowUtil.getBusinessTable(Inspection.class); + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, inspection.getId()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + R result = flowClient.startProcessInstanceById(inspection.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(inspection.getId())), variables); + if (result.isSuccess()) { + // 业务状态:根据整改期限及当前日期判断是否超时整改 + inspection.setState(inspection.getRectifyDeadline().before(DataFormatUtil.getLocalDate()) ? PROBLEM_STATE_OVERTIME_SUBMIT : PROBLEM_STATE_SUBMIT); + inspection.setStatus(HANDIN_STATE_AUDIT);//流程状态 -审批中 + inspection.setRectifyStatus("1");//整改是否完成 1-是 + inspection.setProcessInstanceId(result.getData().getProcessInstanceId()); + }else{ + return R.fail(400,"开启流程失败"); + } + this.updateById(inspection); + log.info("==============[提交整改结果]结束=============="); + return R.success("提交成功"); + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean removeInspectionAndLineByIds(List toLongList) { + toLongList.forEach(formId -> { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(InspectionLine::getFormId, String.valueOf(formId)); + inspectionLineService.remove(queryWrapper); + }); + return this.removeByIds(toLongList); + } + + /** + * 查询表单详情 + */ + @Override + public InspectionVO getInspectionData(String id) { + //获取监督检查主表信息 + Inspection inspection = super.getById(id); + InspectionVO inspectionVO = Func.copy(inspection, InspectionVO.class); + setReturnResult(inspectionVO); + //获取检查部门idList + getInspectDept(inspection, inspectionVO); + //获取被检查部门idList + getInspectedDept(inspection, inspectionVO); + //获取明细信息 + List lineList = inspectionLineService.list(new QueryWrapper().eq("FORM_ID", id)); + if (Func.isNotEmpty(lineList)) { + inspectionVO.setInspectionLineVOList(lineList); + } + //附件 + inspectionVO.setFileList(fileService.getAttachments(inspection.getId(), inspection.getFileIds())); + return inspectionVO; + } + + /** + * 获取检查部门idList + */ + private void getInspectDept(Inspection inspection, InspectionVO inspectionVO) { + if (!(INSPECTION_TYPE_OUT.equals(inspection.getCheckType()))) { + Department inspectDepId = departmentService.getById(inspection.getInspectDep()); + if (Func.isNotEmpty(inspectDepId)) { + //检查部门为红塔银行 + if (PARENT_ID.equals(String.valueOf(inspectDepId.getParentId()))) { + ArrayList list = new ArrayList<>(); + list.add(String.valueOf(inspectDepId.getId())); + inspectionVO.setOrgOptions(list); + } else { + List list = Arrays.stream(inspectDepId.getAncestors().split(",")).collect(Collectors.toList()); + list.remove(0); + list.add(inspection.getInspectDep()); + inspectionVO.setOrgOptions(list); + } + } + } + } + + /** + * 获取被检查部门idList + */ + private void getInspectedDept(Inspection inspection, InspectionVO inspectionVO) { + Department inspectedDepId = departmentService.getById(inspection.getInspectedDep()); + if (Func.isNotEmpty(inspectedDepId)) { + //被检查部门为红塔银行 + if (PARENT_ID.equals(String.valueOf(inspectedDepId.getParentId()))) { + ArrayList list = new ArrayList<>(); + list.add(String.valueOf(inspectedDepId.getId())); + inspectionVO.setOptions(list); + } else { + List list = Arrays.stream(inspectedDepId.getAncestors().split(",")).collect(Collectors.toList()); + list.remove(0); + list.add(inspection.getInspectedDep()); + inspectionVO.setOptions(list); + } + } + } + + @Override + public Inspection getCheckInspection(String taskId, String deptId, Date creatStartDate, Date creatEndDate) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("TASK_ID", taskId); + wrapper.eq("INSPECTED_DEP", deptId); + wrapper.ge("CREATED_TIME", creatStartDate); + wrapper.le("CREATED_TIME", creatEndDate); +// wrapper.eq("status","0"); + return baseMapper.selectOne(wrapper); + } + + @Override + public List getCheckList(String status) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("STATUS", status); + return baseMapper.selectList(wrapper); + } + + /** + * 新增或更新(暂存)检查表 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public R saveOrUpdateInspection(InspectionDTO inspectionDto) { + if(Func.isEmpty(inspectionDto.getUserId())){ + inspectionDto.setUserId(String.valueOf(AuthUtil.getUserId())); + } + Inspection inspection = Func.copy(inspectionDto, Inspection.class); + //更新主表数据 + super.saveOrUpdate(inspection); + //存储相关附件 + fileService.saveAttachments(inspectionDto.getFileList(),inspection.getId()); + List inspectionLineList = inspectionDto.getInspectionLineList(); + if (Func.isNotEmpty(inspectionLineList)) { + inspectionLineList.forEach(item -> { + item.setFormId(inspection.getId()); + //明细若有单独设置整改期限,则取明细的整改期限;若无,则取主表的整改期限 + item.setRectifyDeadline(Func.isNull(item.getRectifyDeadline())?inspection.getRectifyDeadline():item.getRectifyDeadline()); + item.setDeptId(inspection.getInspectedDep());//明细的提报机构为主表的被检查机构 + item.setUserId(inspection.getRectifyUser());//整改责任人 + item.setFoundDate(inspection.getInspectDate());//检查日期 + item.setFlag(Constant.PROBLEM_STATE_USUUAL); //明细类型默认为普通一次性整改 + item.setState(HANDIN_STATE_DRAFT);//审批状态 未提交审批 + item.setStatus("1".equals(item.getHasProblem())?PROBLEM_STATE_DRAFT:PROBLEM_STATE_NO_PROBLEM);//业务状态:无异常-6,有异常则置为0-待检查 + item.setFormStatus(inspection.getStatus()); + }); + //更新明细表数据 + inspectionLineService.saveOrUpdateBatch(inspectionLineList); + } + return R.data(inspection); + } + + /** + * 提交检查表 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public R handin(InspectionDTO inspectionDto) { + log.info("==============inspection提交检查结果 开始=============="); + R res = saveOrUpdateInspection(inspectionDto); + //明细中检查有异常的项 + List collect = inspectionDto.getInspectionLineList().stream().filter(item -> "1".equals(item.getHasProblem())).collect(Collectors.toList()); + //保存后的主表信息 + Inspection inspection = res.getData(); + + inspection.setStatus(PROBLEM_STATE_WAIT_RECTIFY);//业务状态为已提交待整改 + // 若明细无异常项,主表可挂载审批流 + if (Func.isEmpty(collect)) { + log.info("==============明细无异常项=============="); +// 挂载审批流 + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.INSPECTION_KEY); + if (definitionRes.isSuccess()) { + inspection.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + return R.fail(400,"开启流程失败"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + String businessTable = FlowUtil.getBusinessTable(Inspection.class); + String checkType; + switch (inspection.getCheckType()) { + case "1": case "2": + checkType = "inside"; + break; + case "3": + checkType = "outside"; + break; + default: + throw new ServiceException("不支持的检查类型,请核对后再试!"); + } + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, inspection.getId()) + .set("checkType", checkType) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + R result = flowClient.startProcessInstanceById(inspection.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(inspection.getId())), variables); + if (result.isSuccess()) { + inspection.setProcessInstanceId(result.getData().getProcessInstanceId()); + inspection.setStatus(PROBLEM_STATE_NO_PROBLEM);//业务状态为正常无需整改 + inspection.setState(HANDIN_STATE_AUDIT);//流程状态为进入审批 + inspection.setCheckStatus("0");//是否有异常 0-否 + inspection.setRectifyStatus("");//是否整改完成 置空 + } else { + return R.fail(400, "开启流程失败"); + } + } +// 若明细中有异常项,异常项状态改为待整改 + else if(Func.isNotEmpty(collect)){ + log.info("==============明细有异常项=============="); + //有异常时明细进入整改阶段,主表不进审批流,但万一主表曾进过审批流,目前状态是撤回或驳回,就要将审批状态重置为初始状态 + inspection.setState(HANDIN_STATE_DRAFT); + collect.forEach(item -> { + item.setStatus(PROBLEM_STATE_WAIT_RECTIFY); + //明细若有单独设置整改期限,则取明细的整改期限;若无,则取主表的整改期限 + item.setRectifyDeadline(Func.isNull(item.getRectifyDeadline())?inspection.getRectifyDeadline():item.getRectifyDeadline()); + }); + //更新明细表数据 + inspectionLineService.saveOrUpdateBatch(collect); + } + //更新主表数据 +// this.update(inspection, new UpdateWrapper().lambda().eq(Func.isNotEmpty(inspection.getId()), Inspection::getId, inspection.getId()) +// .eq(Inspection::getState, PROBLEM_STATE_DRAFT)); + super.saveOrUpdate(inspection); + log.info("==============inspection提交检查结果 结束=============="); + return R.success("提交成功"); + } + + @Override + public List getAppBacklog(BladeUser user) { + return baseMapper.getAppBacklog(String.valueOf(user.getUserId()), PROBLEM_STATE_WAIT_RECTIFY); + } + + @Override + public List getUserByRoleId(String roleId,String deptId) { + return baseMapper.getUserByRoleId(roleId,deptId); + } + + @Override + public String getDeptData(String deptId) { + return baseMapper.getDeptData(deptId); + } + + @Override + public List getStatisticsData(InspectionDataDTO inspectionDataDTO, List aimDepts) { + return baseMapper.getStatisticsData(inspectionDataDTO,aimDepts); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DeviceInspectionLineVO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DeviceInspectionLineVO.java new file mode 100644 index 0000000..edce508 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DeviceInspectionLineVO.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.vo; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 任务-设备检查明细视图实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "DeviceInspectionLineVO对象", description = "任务-设备检查明细") +public class DeviceInspectionLineVO extends DeviceInspectionLine { + private static final long serialVersionUID = 1L; + private boolean overFlag; + + + /** + * 整改前图片 + */ + private List beforeImages; + + /** + * 整改后图片 + */ + private List afterImages; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DeviceInspectionVO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DeviceInspectionVO.java new file mode 100644 index 0000000..02b1447 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DeviceInspectionVO.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; + +import java.util.List; + +/** + * 任务-设备检查表视图实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "DeviceInspectionVO对象", description = "任务-设备检查表") +public class DeviceInspectionVO extends DeviceInspection { + private static final long serialVersionUID = 1L; + private String depName; //检查部门名称 + private String deptName; //设备所属部门名称 + + private String inspectUserName; + private String rectifyUserName; + private String deviceTypeName; + + //设备编号 + private String deviceNum; + /** + * 按钮显示控制标识符 0 - 查看 1 - 查看、通过/驳回 + */ + private String buttonStatus; + + /** + * 设备整改记录标识符(1-普通整改,2-持续整改,3-设备检查) + */ + private String rectifyFlag; + + private List deviceInspectionLines; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DevicePictureVO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DevicePictureVO.java new file mode 100644 index 0000000..f293087 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/DevicePictureVO.java @@ -0,0 +1,25 @@ +package org.security.trans.dailyDuties.vo; + +import lombok.Data; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :wzf + * @apiNote :设备整改附件 + * @since :Created in 2022/9/30 15:35 + */ +@Data +public class DevicePictureVO extends DeviceInspectionLine implements Serializable { + /** + * 整改前图片 + */ + private List beforePicList; + /** + * 整改后图片 + */ + private List afterPicList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionLinePage.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionLinePage.java new file mode 100644 index 0000000..38aea69 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionLinePage.java @@ -0,0 +1,29 @@ +package org.security.trans.dailyDuties.vo; +/* + *@date 2022/3/29 14:48 + */ + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.dailyDuties.entity.InspectionLine; + +import java.io.Serializable; +import java.util.List; + +/** + * @author xx + */ +@Data +public class InspectionLinePage implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 页面按钮显示控制标识符(0-不显示,1-显示) + */ + private boolean buttonFlag; + + private List inspectionLineList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionLineVO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionLineVO.java new file mode 100644 index 0000000..f1b12c8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionLineVO.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.entity.InspectionLine; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.Func; + +import java.util.List; + +import static org.security.common.Constant.PROBLEM_STATE_DRAFT; +import static org.security.common.Constant.PROBLEM_STATE_DRAFT_OVERTIME; + +/** + * 任务-监督检查明细视图实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "InspectionLineVO对象", description = "任务-监督检查明细") +public class InspectionLineVO extends InspectionLine { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + @ApiModelProperty(value = "整改前照片") + private List checkPicList; + @ApiModelProperty(value = "整改后照片") + private List rectifyPicList; + + + // 是否可编辑 + private boolean editable; + + public boolean isEditable() { + if ((Constant.PROBLEM_STATE_WAIT_RECTIFY.equals(this.getStatus()) + || Constant.PROBLEM_STATE_OVERTIME.equals(this.getStatus()) + || ProcessConstant.CANCEL_STATE.equals(this.getState()) + || Constant.HANDIN_STATE_REFUSE.equals(this.getState())) + && (Func.isEmpty(this.getUserId()) || this.getUserId().contains(String.valueOf(AuthUtil.getUserId()))) + ) { + return true; + } + return false; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionVO.java b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionVO.java new file mode 100644 index 0000000..48beda8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dailyDuties/vo/InspectionVO.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.dailyDuties.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.entity.Inspection; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.trans.dailyDuties.entity.InspectionLine; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.Func; + +import java.util.List; + +import static org.security.common.Constant.PROBLEM_STATE_DRAFT; +import static org.security.common.Constant.PROBLEM_STATE_DRAFT_OVERTIME; + +/** + * 任务-监督检查表视图实体类 + * + * @author BladeX + * @since 2022-03-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "InspectionVO对象", description = "任务-监督检查表") +public class InspectionVO extends Inspection { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "相关附件") + private List fileList; + + /** + * 按钮显示控制标识符(0-(待检查状态)查看、编辑、删除;1-(待整改/超时未整改)查看、问题整改、提报;2-(按时整改/超时整改)查看、驳回/通过);3-(不是任务指定提报角色、不是指定整改角色,也不是流程审批中的角色)查看 + */ + private String buttonStatus; + /** + * 提报单位名称 + */ + private String deptName; + /** + * 检查单位名称 + */ + private String inspectDepName; + /** + * 被检查单位名称 + */ + private String inspectedDepName; + /** + * 关联任务名称 + */ + private String taskName; + /** + * 整改责任人名称 + */ + private String rectifyUserName; + + /** + * 检查单位 + */ + private List orgOptions; + + /** + * 被检查单位 + */ + private List options; + + private List inspectionLineVOList; + // 是否可编辑 + private boolean editable; + // 是否可删除 + private boolean deletable; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + + public boolean isEditable() { + //待检查 或 超时待检查 或 审批撤回 或 审批驳回 +// //且用户的角色符合待办角色或是待办人 + if ((PROBLEM_STATE_DRAFT.equals(this.getStatus()) || PROBLEM_STATE_DRAFT_OVERTIME.equals(this.getStatus()) || ProcessConstant.CANCEL_STATE.equals(this.getState()) || Constant.HANDIN_STATE_REFUSE.equals(this.getState())) + && (AuthUtil.getUser().getRoleId().contains(this.getRoleId()) || this.getUserId().contains(String.valueOf(AuthUtil.getUserId())))) { + return true; + } + return false; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/AnswerAlarmDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/AnswerAlarmDataController.java new file mode 100644 index 0000000..4d576d8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/AnswerAlarmDataController.java @@ -0,0 +1,42 @@ +package org.security.trans.dataStatistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.AnswerAlarmDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.AnswerAlarmDataService; +import org.security.trans.dataStatistics.service.IEmployeeDataService; +import org.security.trans.dataStatistics.vo.AnswerAlarmDataVO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +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; + +/** + * @author :wzf + * @apiNote :数据统计-联系接警记录 + * @since :Created in 2022/10/31 18:19 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/answer-alarm") +public class AnswerAlarmDataController { + private final AnswerAlarmDataService answerAlarmDataService; + + + /** + * 统计列表 + */ + @PostMapping("/table") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "统计列表", notes = "statisticsDataDTO") + public R> getTableData(@RequestBody AnswerAlarmDataDTO answerAlarmDataDTO, Query query) { + return R.data(answerAlarmDataService.getTableData(answerAlarmDataDTO, Condition.getPage(query))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/AssessmentDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/AssessmentDataController.java new file mode 100644 index 0000000..182105b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/AssessmentDataController.java @@ -0,0 +1,40 @@ +package org.security.trans.dataStatistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.AssessmentDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.AssessmentDataService; +import org.security.trans.dataStatistics.vo.AssessmentDataVO; +import org.security.trans.dataStatistics.vo.EduAndDrillDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +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; + +/** + * @author :wzf + * @apiNote :考核评价数据统计 + * @since :Created in 2022/11/24 11:31 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/assessment") +public class AssessmentDataController { + + private final AssessmentDataService assessmentDataService; + /** + * 统计列表 + */ + @PostMapping("/table") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "统计列表", notes = "statisticsDataDTO") + public R> getTableData(@RequestBody AssessmentDataDTO assessmentDataDTO, Query query) { + return R.data(assessmentDataService.getTableData(assessmentDataDTO, Condition.getPage(query))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/DeviceDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/DeviceDataController.java new file mode 100644 index 0000000..061b5da --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/DeviceDataController.java @@ -0,0 +1,47 @@ +package org.security.trans.dataStatistics.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.DeviceDataDTO; +import org.security.trans.dataStatistics.service.DeviceDataService; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.dataStatistics.vo.RisingSunChartDeviceVo; +import org.security.trans.dataStatistics.vo.RisingSunChartVO; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author :wzf + * @apiNote :设备统计 + * @since :Created in 2022/11/28 14:56 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/device") +public class DeviceDataController { + + + private final DeviceDataService deviceDataService; + + /** + * 统计旭日图 + */ + @PostMapping("/ris-sun-chart") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "旭日图", notes = "") + public R getRisSunChartData(@RequestBody DeviceDataDTO deviceDataDTO) { + return R.data(deviceDataService.getRisSunChartData(deviceDataDTO)); + } + /** + * 设备按机构分布饼图 + */ + @PostMapping("/pie-dept") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "机构饼图", notes = "") + public R> getPieDeptData(@RequestBody DeviceDataDTO deviceDataDTO) { + return R.data(deviceDataService.getPieDeptData(deviceDataDTO)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/DeviceInspectionDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/DeviceInspectionDataController.java new file mode 100644 index 0000000..1aa60b2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/DeviceInspectionDataController.java @@ -0,0 +1,41 @@ +package org.security.trans.dataStatistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.AssessmentDataDTO; +import org.security.trans.dataStatistics.dto.DeviceInspectionDataDTO; +import org.security.trans.dataStatistics.service.DeviceInspectionDataService; +import org.security.trans.dataStatistics.vo.AssessmentDataVO; +import org.security.trans.dataStatistics.vo.DeviceInspectionDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +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; + +/** + * @author :wzf + * @apiNote :设备检查整改数据统计 + * @since :Created in 2022/11/24 19:41 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/device-inspection") +public class DeviceInspectionDataController { + + private final DeviceInspectionDataService deviceInspectionDataService; + + /** + * 统计列表 + */ + @PostMapping("/table") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "统计列表", notes = "deviceInspectionDataDTO") + public R> getTableData(@RequestBody DeviceInspectionDataDTO deviceInspectionDataDTO, Query query) { + return R.data(deviceInspectionDataService.getTableData(deviceInspectionDataDTO, Condition.getPage(query))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/EduAndDrillDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/EduAndDrillDataController.java new file mode 100644 index 0000000..7c9e051 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/EduAndDrillDataController.java @@ -0,0 +1,41 @@ +package org.security.trans.dataStatistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.EduAndDrillDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.EduAndDrillDataService; +import org.security.trans.dataStatistics.vo.EduAndDrillDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +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; + +/** + * @author :wzf + * @apiNote :应急演练和教育培训统计数据获取 + * @since :Created in 2022/11/23 9:42 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/edu-drill") +public class EduAndDrillDataController { + + + private final EduAndDrillDataService eduAndDrillDataService; + + /** + * 统计列表 + */ + @PostMapping("/table") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "统计列表", notes = "statisticsDataDTO") + public R> getTableData(@RequestBody EduAndDrillDataDTO eduAndDrillDataDTO, Query query) { + return R.data(eduAndDrillDataService.getTableData(eduAndDrillDataDTO, Condition.getPage(query))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/EmployeeDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/EmployeeDataController.java new file mode 100644 index 0000000..c342290 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/EmployeeDataController.java @@ -0,0 +1,110 @@ +package org.security.trans.dataStatistics.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.vo.HistogramDataVO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.basic.dto.EmployeeDTO; +import org.security.trans.dataStatistics.service.IEmployeeDataService; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/5/23 11:37 + * 基础信息模块-数据统计 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/data-count") +public class EmployeeDataController { + + private final IEmployeeDataService iEmployeeDataService; + + /** + * 性别构成饼图 + */ + @GetMapping("/pie-sex") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "性别构成饼图", notes = "employeeDTO") + public R> getSexData(EmployeeDTO employeeDTO, Query query) { + return R.data(iEmployeeDataService.getSexData(employeeDTO,query)); + } + + + /** + * 年龄结构柱状图 + */ + @GetMapping("/histogram-age") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "年龄结构柱状图", notes = "employeeDTO") + public R> getAgeData(EmployeeDTO employeeDTO, Query query) { + return R.data(iEmployeeDataService.getAgeData(employeeDTO,query)); + } + + /** + * 学历构成饼图 + */ + @GetMapping("/pie-educate") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "学历构成饼图", notes = "employeeDTO") + public R> getEducateData(EmployeeDTO employeeDTO, Query query) { + return R.data(iEmployeeDataService.getEducateData(employeeDTO,query)); + } + + /** + * 企业工龄柱状图 + */ + @GetMapping("/histogram-seniority-in-enterprise") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "企业工龄柱状图", notes = "employeeDTO") + public R> getSeniorityInEnterpriseData(EmployeeDTO employeeDTO, Query query) { + return R.data(iEmployeeDataService.getSeniorityInEnterpriseData(employeeDTO,query)); + } + + /** + * 行内工龄柱状图 + */ + @GetMapping("/histogram-professional-length-of-service") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "行内工龄柱状图", notes = "employeeDTO") + public R> getProfessionalLengthOfServiceData(EmployeeDTO employeeDTO, Query query) { + return R.data(iEmployeeDataService.getProfessionalLengthOfServiceData(employeeDTO,query)); + } + + /** + * 人防类型构成饼图 + */ + @GetMapping("/pie-civil-air-defense-type") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "人防类型构成饼图", notes = "employeeDTO") + public R> getCivilAirDefenseTypeData(EmployeeDTO employeeDTO, Query query) { + return R.data(iEmployeeDataService.getCivilAirDefenseTypeData(employeeDTO,query)); + } + + /** + * 民族构成饼图 + */ + @GetMapping("/pie-nation-type") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "民族构成饼图", notes = "employeeDTO") + public R> getNationTypeData(EmployeeDTO employeeDTO, Query query) { + return R.data(iEmployeeDataService.getNationTypeData(employeeDTO)); + } + + /** + * 政治面貌构成饼图 + */ + @GetMapping("/pie-political-outlook-type") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "政治面貌构成饼图", notes = "employeeDTO") + public R> getPoliticalOutlookTypeData(EmployeeDTO employeeDTO, Query query) { + return R.data(iEmployeeDataService.getPoliticalOutlookTypeData(employeeDTO)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/InspectionDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/InspectionDataController.java new file mode 100644 index 0000000..f978444 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/InspectionDataController.java @@ -0,0 +1,36 @@ +package org.security.trans.dataStatistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.InspectionDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.InspectionDataService; +import org.security.trans.dataStatistics.vo.InspectionDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; +/** + * @author :wzf + * @apiNote :数据统计-现场检查 + * @since :Created in 2022/10/27 17:14 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/inspection") +public class InspectionDataController { + + private final InspectionDataService inspectionDataService; + + /** + * 统计列表 + */ + @PostMapping("/table") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "统计列表", notes = "statisticsDataDTO") + public R> getTableData(@RequestBody InspectionDataDTO inspectionDataDTO, Query query) { + return R.data(inspectionDataService.getTableData(inspectionDataDTO, Condition.getPage(query))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/MaterialDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/MaterialDataController.java new file mode 100644 index 0000000..e00c394 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/MaterialDataController.java @@ -0,0 +1,41 @@ +package org.security.trans.dataStatistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.MaterialDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.MaterialDataService; +import org.security.trans.dataStatistics.vo.AnswerAlarmDataVO; +import org.security.trans.dataStatistics.vo.MaterialDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +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; + +/** + * @author :wzf + * @apiNote :案件材料报送统计 + * @since :Created in 2022/11/24 9:54 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/material") +public class MaterialDataController { + + private final MaterialDataService materialDataService; + + /** + * 统计列表 + */ + @PostMapping("/table") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "统计列表", notes = "statisticsDataDTO") + public R> getTableData(@RequestBody MaterialDataDTO materialDataDTO, Query query) { + return R.data(materialDataService.getTableData(materialDataDTO, Condition.getPage(query))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/OutEmployeeDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/OutEmployeeDataController.java new file mode 100644 index 0000000..60f0627 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/OutEmployeeDataController.java @@ -0,0 +1,73 @@ +package org.security.trans.dataStatistics.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.basic.dto.EmployeeDTO; +import org.security.trans.dataStatistics.service.OutEmployeeDataService; +import org.security.trans.dataStatistics.vo.HistogramDataVO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.outsourcing.dto.OutEmployeeDTO; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author :wzf + * @apiNote :外包公司员工数据统计实现 + * @since :Created in 2022/12/2 11:32 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/out-employee-count") +public class OutEmployeeDataController { + + private final OutEmployeeDataService outEmployeeDataService; + + + /** + * 性别构成饼图 + */ + @GetMapping("/pie-sex") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "性别构成饼图", notes = "employeeDTO") + public R> getSexData(OutEmployeeDTO outEmployeeDTO) { + return R.data(outEmployeeDataService.getSexData(outEmployeeDTO)); + } + + + /** + * 年龄结构柱状图 + */ + @GetMapping("/histogram-age") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "年龄结构柱状图", notes = "employeeDTO") + public R> getAgeData(OutEmployeeDTO outEmployeeDTO) { + return R.data(outEmployeeDataService.getAgeData(outEmployeeDTO)); + } + + + /** + * 民族构成饼图 + */ + @GetMapping("/pie-nation-type") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "民族构成饼图", notes = "employeeDTO") + public R> getNationTypeData(OutEmployeeDTO outEmployeeDTO) { + return R.data(outEmployeeDataService.getNationTypeData(outEmployeeDTO)); + } + + /** + * 政治面貌构成饼图 + */ + @GetMapping("/pie-political-outlook-type") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "政治面貌构成饼图", notes = "employeeDTO") + public R> getPoliticalOutlookTypeData(OutEmployeeDTO outEmployeeDTO) { + return R.data(outEmployeeDataService.getPoliticalOutlookTypeData(outEmployeeDTO)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/ProjectDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/ProjectDataController.java new file mode 100644 index 0000000..e54f5cf --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/ProjectDataController.java @@ -0,0 +1,73 @@ +package org.security.trans.dataStatistics.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.ProjectDataService; +import org.security.trans.dataStatistics.vo.HistogramDataVO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.projectBudgetManagement.dto.ProjectDTO; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author :wzf + * @apiNote :项目管理数据统计 + * @since :Created in 2022/12/2 15:22 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/project") +public class ProjectDataController { + + private final ProjectDataService projectDataService; + + + /** + * 项目类型饼图 + */ + @GetMapping("/pie-type") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "项目类型饼图", notes = "statisticsDataDTO") + public R> getProjectTypeData(StatisticsDataDTO statisticsDataDTO) { + return R.data(projectDataService.getProjectTypeData(statisticsDataDTO)); + } + + + /** + * 项目节点柱状图 + */ + @GetMapping("/histogram-node") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "项目节点柱状图", notes = "statisticsDataDTO") + public R> getProjectNodeData(StatisticsDataDTO statisticsDataDTO) { + return R.data(projectDataService.getProjectNodeData(statisticsDataDTO)); + } + + + /** + * 项目合同金额饼图 + */ + @GetMapping("/pie-concat-amt") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "项目合同金额饼图", notes = "statisticsDataDTO") + public R> getConcatAmtData(StatisticsDataDTO statisticsDataDTO) { + return R.data(projectDataService.getConcatAmtData(statisticsDataDTO)); + } + + + /** + * 项目支付计划-支付情况饼图 + */ + @GetMapping("/pie-pay") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "项目支付计划-支付情况饼图", notes = "statisticsDataDTO") + public R> getPayData(StatisticsDataDTO statisticsDataDTO) { + return R.data(projectDataService.getPayData(statisticsDataDTO)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/RectificationNoticeController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/RectificationNoticeController.java new file mode 100644 index 0000000..ba4c47d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/RectificationNoticeController.java @@ -0,0 +1,41 @@ +package org.security.trans.dataStatistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.RectificationNoticeService; +import org.security.trans.dataStatistics.vo.RectificationNoticeDataVO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +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; + +/** + * @author :wzf + * @apiNote :数据统计-整改通知书 + * @since :Created in 2022/10/31 14:28 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/rectification/notice") +public class RectificationNoticeController { + + private final RectificationNoticeService rectificationNoticeService; + + /** + * 统计列表 + */ + @PostMapping("/table") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "统计列表", notes = "statisticsDataDTO") + public R> getTableData(@RequestBody StatisticsDataDTO statisticsDataDTO, Query query) { + return R.data(rectificationNoticeService.getTableData(statisticsDataDTO, Condition.getPage(query))); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/RiskDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/RiskDataController.java new file mode 100644 index 0000000..8c9166c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/RiskDataController.java @@ -0,0 +1,41 @@ +package org.security.trans.dataStatistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.RiskDataService; +import org.security.trans.dataStatistics.vo.MaterialDataVO; +import org.security.trans.dataStatistics.vo.RiskDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +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; + +/** + * @author :wzf + * @apiNote :风险提示数据统计 + * @since :Created in 2022/11/24 10:27 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/risk") +public class RiskDataController { + + private final RiskDataService riskDataService; + + + /** + * 统计列表 + */ + @PostMapping("/table") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "统计列表", notes = "statisticsDataDTO") + public R> getTableData(@RequestBody StatisticsDataDTO statisticsDataDTO, Query query) { + return R.data(riskDataService.getTableData(statisticsDataDTO, Condition.getPage(query))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/UnlocaleCheckDataController.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/UnlocaleCheckDataController.java new file mode 100644 index 0000000..d5f523d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/controller/UnlocaleCheckDataController.java @@ -0,0 +1,40 @@ +package org.security.trans.dataStatistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.dto.UnlocaleCheckDataDTO; +import org.security.trans.dataStatistics.service.UnlocaleCheckDataService; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +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; + +/** + * @author :wzf + * @apiNote :数据统计-非现场检查 + * @since :Created in 2022/10/28 17:34 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/statistics/unlocale-check") +public class UnlocaleCheckDataController { + + private final UnlocaleCheckDataService unlocaleCheckDataService; + + /** + * 统计列表 + */ + @PostMapping("/table") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "统计列表", notes = "statisticsDataDTO") + public R> getTableData(@RequestBody UnlocaleCheckDataDTO unlocaleCheckDataDTO, Query query) { + return R.data(unlocaleCheckDataService.getTableData(unlocaleCheckDataDTO, Condition.getPage(query))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/AnswerAlarmDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/AnswerAlarmDataDTO.java new file mode 100644 index 0000000..7cd6fa6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/AnswerAlarmDataDTO.java @@ -0,0 +1,19 @@ +package org.security.trans.dataStatistics.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :联系接警记录数据统计请求参数 + * @since :Created in 2022/11/25 10:22 + */ +@Data +public class AnswerAlarmDataDTO extends StatisticsDataDTO implements Serializable { + + /** + * 检查类型 + */ + private String type; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/AssessmentDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/AssessmentDataDTO.java new file mode 100644 index 0000000..dbc74b3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/AssessmentDataDTO.java @@ -0,0 +1,28 @@ +package org.security.trans.dataStatistics.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :考核评价数据统计请求参数 + * @since :Created in 2022/11/24 14:51 + */ +@Data +public class AssessmentDataDTO extends StatisticsDataDTO implements Serializable { + /** + * 统计数据类型:1-机构考核统计,2-相关方考核统计,3-项目考核统计 + */ + private String dataType; + + /** + * 项目考核-项目id + */ + private String projectId; + + /** + * 相关方考核-被考评公司/机构考核-被考评机构 + */ + private String evaluated; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/DeviceDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/DeviceDataDTO.java new file mode 100644 index 0000000..ecfc8eb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/DeviceDataDTO.java @@ -0,0 +1,11 @@ +package org.security.trans.dataStatistics.dto; + +import java.io.Serializable; + +/** + * @author nantian.yangzhengyu + * @date 2023/2/8 9:17 + */ +public class DeviceDataDTO extends StatisticsDataDTO implements Serializable { + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/DeviceInspectionDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/DeviceInspectionDataDTO.java new file mode 100644 index 0000000..d1d7c1f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/DeviceInspectionDataDTO.java @@ -0,0 +1,19 @@ +package org.security.trans.dataStatistics.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :设备检查整改的统计返回实体 + * @since :Created in 2022/11/24 19:38 + */ +@Data +public class DeviceInspectionDataDTO extends StatisticsDataDTO implements Serializable { + + /** + * 设备类型 + */ + private String typeId; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/EduAndDrillDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/EduAndDrillDataDTO.java new file mode 100644 index 0000000..89c0aad --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/EduAndDrillDataDTO.java @@ -0,0 +1,24 @@ +package org.security.trans.dataStatistics.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :教育培训和应急演练数据统计请求参数 + * @since :Created in 2022/11/24 14:17 + */ +@Data +public class EduAndDrillDataDTO extends StatisticsDataDTO implements Serializable { + + /** + * 统计数据类型:1-教育培训,2-应急演练 + */ + private String dataType; + + /** + * 类型 + */ + private String businessType; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/InspectionDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/InspectionDataDTO.java new file mode 100644 index 0000000..a0c9238 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/InspectionDataDTO.java @@ -0,0 +1,19 @@ +package org.security.trans.dataStatistics.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :现场检查整改统计请求参数 + * @since :Created in 2022/11/25 9:51 + */ +@Data +public class InspectionDataDTO extends StatisticsDataDTO implements Serializable { + + /** + * 检查类型 + */ + private String type; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/MaterialDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/MaterialDataDTO.java new file mode 100644 index 0000000..dd6809d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/MaterialDataDTO.java @@ -0,0 +1,19 @@ +package org.security.trans.dataStatistics.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :案件材料报送数据统计请求参数 + * @since :Created in 2022/11/25 10:34 + */ +@Data +public class MaterialDataDTO extends StatisticsDataDTO implements Serializable { + + /** + * 类型 + */ + private String type; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/StatisticsDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/StatisticsDataDTO.java new file mode 100644 index 0000000..879a761 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/StatisticsDataDTO.java @@ -0,0 +1,49 @@ +package org.security.trans.dataStatistics.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author :wzf + * @apiNote :数据统计前端请求公共参数 + * @since :Created in 2022/10/27 16:50 + */ +@Data +public class StatisticsDataDTO implements Serializable { + + /** + * 统计机构id + */ + @ApiModelProperty(value = "统计机构id") + private String deptId; + + /** + * 统计开始时间 + */ + @ApiModelProperty(value = "统计开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATE) + private Date beginDate; + + /** + * 统计结束时间 + */ + @ApiModelProperty(value = "统计结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = DateUtil.PATTERN_DATE) + private Date endDate; + + /** + * 统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级) + */ + @ApiModelProperty(value = "统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级)") + private String includeChildren; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/UnlocaleCheckDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/UnlocaleCheckDataDTO.java new file mode 100644 index 0000000..be5915e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/dto/UnlocaleCheckDataDTO.java @@ -0,0 +1,19 @@ +package org.security.trans.dataStatistics.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :非现场检查整改请求参数 + * @since :Created in 2022/11/25 10:11 + */ +@Data +public class UnlocaleCheckDataDTO extends StatisticsDataDTO implements Serializable { + + /** + * 检查类型 + */ + private String checkType; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/entity/DeviceData.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/entity/DeviceData.java new file mode 100644 index 0000000..e44f8e6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/entity/DeviceData.java @@ -0,0 +1,49 @@ +package org.security.trans.dataStatistics.entity; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :设备统计查询结果对象 + * @since :Created in 2022/11/28 15:33 + */ +@Data +public class DeviceData implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 设备类型id + */ + private String id; + + /** + * 设备类型名称 + */ + private String name; + + /** + * 设备类型父级id + */ + private String parentId; + + /** + * 设备数量 + */ + private int num; + /** + * 设备所属机构 + */ + private String deptId; + /** + * 设备所属机构名称 + */ + private String deptName; + + /** + * 设备所属上级机构 + */ + private String parentDeptId; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/AnswerAlarmDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/AnswerAlarmDataService.java new file mode 100644 index 0000000..a754dee --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/AnswerAlarmDataService.java @@ -0,0 +1,13 @@ +package org.security.trans.dataStatistics.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.AnswerAlarmDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.AnswerAlarmDataVO; + +/** + * @author :wzf + * @since :Created in 2022/11/22 15:10 + */ +public interface AnswerAlarmDataService { + IPage getTableData(AnswerAlarmDataDTO answerAlarmDataDTO, IPage page); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/AssessmentDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/AssessmentDataService.java new file mode 100644 index 0000000..b42d0c6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/AssessmentDataService.java @@ -0,0 +1,21 @@ +package org.security.trans.dataStatistics.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.AssessmentDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.AssessmentDataVO; + +/** + * @author :wzf + * @apiNote :考核评价数据统计 + * @since :Created in 2022/11/24 11:33 + */ +public interface AssessmentDataService { + /** + * 考核评价数据统计 + * @param assessmentDataDTO + * @param page + * @return + */ + IPage getTableData(AssessmentDataDTO assessmentDataDTO, IPage page); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/DeviceDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/DeviceDataService.java new file mode 100644 index 0000000..6b4fa50 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/DeviceDataService.java @@ -0,0 +1,19 @@ +package org.security.trans.dataStatistics.service; + +import org.security.trans.dataStatistics.dto.DeviceDataDTO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.dataStatistics.vo.RisingSunChartDeviceVo; +import org.security.trans.dataStatistics.vo.RisingSunChartVO; + +import java.util.List; + +/** + * @author :wzf + * @since :Created in 2022/11/28 15:13 + */ +public interface DeviceDataService { + RisingSunChartDeviceVo getRisSunChartData(DeviceDataDTO deviceDataDTO); + + List getPieDeptData(DeviceDataDTO deviceDataDTO); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/DeviceInspectionDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/DeviceInspectionDataService.java new file mode 100644 index 0000000..373ba87 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/DeviceInspectionDataService.java @@ -0,0 +1,13 @@ +package org.security.trans.dataStatistics.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.DeviceInspectionDataDTO; +import org.security.trans.dataStatistics.vo.DeviceInspectionDataVO; + +/** + * @author :wzf + * @since :Created in 2022/11/24 19:43 + */ +public interface DeviceInspectionDataService { + IPage getTableData(DeviceInspectionDataDTO deviceInspectionDataDTO, IPage page); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/EduAndDrillDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/EduAndDrillDataService.java new file mode 100644 index 0000000..f1c73b4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/EduAndDrillDataService.java @@ -0,0 +1,14 @@ +package org.security.trans.dataStatistics.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.EduAndDrillDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.EduAndDrillDataVO; + +/** + * @author :wzf + * @since :Created in 2022/11/23 9:59 + */ +public interface EduAndDrillDataService { + IPage getTableData(EduAndDrillDataDTO eduAndDrillDataDTO, IPage page); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/IEmployeeDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/IEmployeeDataService.java new file mode 100644 index 0000000..bc50417 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/IEmployeeDataService.java @@ -0,0 +1,65 @@ +package org.security.trans.dataStatistics.service; + +import org.security.trans.dataStatistics.vo.HistogramDataVO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.basic.dto.EmployeeDTO; +import org.springblade.core.mp.support.Query; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/5/23 14:45 + */ +public interface IEmployeeDataService { + /** + * 获取员工性别比列 + * @param employeeDTO 数据统计条件 + * @param query + * @return + */ + List getSexData(EmployeeDTO employeeDTO, Query query); + + /** + * 年龄结构柱状图 + * @param employeeDTO 数据统计条件 + * @param query + * @return + */ + List getAgeData(EmployeeDTO employeeDTO, Query query); + + /** + * 学历构成饼图 + * @param employeeDTO 数据统计条件 + * @param query + * @return + */ + List getEducateData(EmployeeDTO employeeDTO, Query query); + + /** + * 企业工龄柱状图 + * @param employeeDTO 数据统计条件 + * @param query + * @return + */ + List getSeniorityInEnterpriseData(EmployeeDTO employeeDTO, Query query); + + /** + * 行内工龄柱状图 + * @param employeeDTO 数据统计条件 + * @param query + * @return + */ + List getProfessionalLengthOfServiceData(EmployeeDTO employeeDTO, Query query); + + /** + * 人防类型构成饼图 + * @param employeeDTO 数据统计条件 + * @param query + * @return + */ + List getCivilAirDefenseTypeData(EmployeeDTO employeeDTO, Query query); + + List getNationTypeData(EmployeeDTO employeeDTO); + + List getPoliticalOutlookTypeData(EmployeeDTO employeeDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/InspectionDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/InspectionDataService.java new file mode 100644 index 0000000..e866b3a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/InspectionDataService.java @@ -0,0 +1,21 @@ +package org.security.trans.dataStatistics.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dailyDuties.vo.InspectionVO; +import org.security.trans.dataStatistics.dto.InspectionDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.InspectionDataVO; +import org.springblade.core.mp.support.Query; + +import java.util.List; + +/** + * @author :wzf + * @since :Created in 2022/10/27 17:18 + */ +public interface InspectionDataService { + /** + * 统计列表 + */ + IPage getTableData(InspectionDataDTO inspectionDataDTO, IPage page); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/MaterialDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/MaterialDataService.java new file mode 100644 index 0000000..bcf58a7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/MaterialDataService.java @@ -0,0 +1,20 @@ +package org.security.trans.dataStatistics.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.MaterialDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.MaterialDataVO; + +/** + * @author :wzf + * @since :Created in 2022/11/24 9:59 + */ +public interface MaterialDataService { + /** + * 案件材料报送统计 + * @param materialDataDTO + * @param page + * @return + */ + IPage getTableData(MaterialDataDTO materialDataDTO, IPage page); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/OutEmployeeDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/OutEmployeeDataService.java new file mode 100644 index 0000000..e582504 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/OutEmployeeDataService.java @@ -0,0 +1,21 @@ +package org.security.trans.dataStatistics.service; + +import org.security.trans.dataStatistics.vo.HistogramDataVO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.outsourcing.dto.OutEmployeeDTO; + +import java.util.List; + +/** + * @author :wzf + * @since :Created in 2022/12/2 11:34 + */ +public interface OutEmployeeDataService { + List getSexData(OutEmployeeDTO outEmployeeDTO); + + List getAgeData(OutEmployeeDTO outEmployeeDTO); + + List getNationTypeData(OutEmployeeDTO outEmployeeDTO); + + List getPoliticalOutlookTypeData(OutEmployeeDTO outEmployeeDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/ProjectDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/ProjectDataService.java new file mode 100644 index 0000000..b78044e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/ProjectDataService.java @@ -0,0 +1,45 @@ +package org.security.trans.dataStatistics.service; + +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.HistogramDataVO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; + +import java.util.List; + +/** + * @author :wzf + * @since :Created in 2022/12/2 15:24 + */ +public interface ProjectDataService { + /** + * 项目类型饼图 + * + * @param statisticsDataDTO 检索条件 + * @return + */ + List getProjectTypeData(StatisticsDataDTO statisticsDataDTO); + + /** + * 项目节点柱状图 + * + * @param statisticsDataDTO 检索条件 + * @return + */ + List getProjectNodeData(StatisticsDataDTO statisticsDataDTO); + + /** + * 项目合同金额饼图 + * + * @param statisticsDataDTO 检索条件 + * @return + */ + List getConcatAmtData(StatisticsDataDTO statisticsDataDTO); + + /** + * 目支付计划-支付情况饼图 + * + * @param statisticsDataDTO 检索条件 + * @return + */ + List getPayData(StatisticsDataDTO statisticsDataDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/RectificationNoticeService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/RectificationNoticeService.java new file mode 100644 index 0000000..8c1045a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/RectificationNoticeService.java @@ -0,0 +1,13 @@ +package org.security.trans.dataStatistics.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.RectificationNoticeDataVO; + +/** + * @author :wzf + * @since :Created in 2022/10/31 14:30 + */ +public interface RectificationNoticeService { + IPage getTableData(StatisticsDataDTO statisticsDataDTO, IPage page); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/RiskDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/RiskDataService.java new file mode 100644 index 0000000..54a4078 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/RiskDataService.java @@ -0,0 +1,19 @@ +package org.security.trans.dataStatistics.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.RiskDataVO; + +/** + * @author :wzf + * @since :Created in 2022/11/24 10:29 + */ +public interface RiskDataService { + /** + * 风险提示数据统计 + * @param statisticsDataDTO + * @param page + * @return + */ + IPage getTableData(StatisticsDataDTO statisticsDataDTO, IPage page); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/UnlocaleCheckDataService.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/UnlocaleCheckDataService.java new file mode 100644 index 0000000..934d827 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/UnlocaleCheckDataService.java @@ -0,0 +1,20 @@ +package org.security.trans.dataStatistics.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.dto.UnlocaleCheckDataDTO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; + +/** + * @author :wzf + * @since :Created in 2022/10/28 17:35 + */ +public interface UnlocaleCheckDataService { + /** + * 非现场检查数据统计-表格数据 + * @param unlocaleCheckDataDTO 条件参数 + * @param page 分页参数 + * @return + */ + IPage getTableData(UnlocaleCheckDataDTO unlocaleCheckDataDTO, IPage page); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/AnswerAlarmDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/AnswerAlarmDataServiceImpl.java new file mode 100644 index 0000000..04fc543 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/AnswerAlarmDataServiceImpl.java @@ -0,0 +1,109 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.dataStatistics.dto.AnswerAlarmDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.AnswerAlarmDataService; +import org.security.trans.dataStatistics.util.CalculationRatioUtil; +import org.security.trans.dataStatistics.vo.AnswerAlarmDataVO; +import org.security.trans.securityCommandCenter.service.ISccAnswerAlarmService; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @since :Created in 2022/11/22 15:11 + */ +@Service +@Slf4j +@AllArgsConstructor +public class AnswerAlarmDataServiceImpl implements AnswerAlarmDataService { + + private final InspectionDataServiceImpl inspectionDataService; + private final ISccAnswerAlarmService sccAnswerAlarmService; + + + + @Override + public IPage getTableData(AnswerAlarmDataDTO answerAlarmDataDTO, IPage page) { + log.info("---------------------联系接警记录数据统计列表数据获取开始---------------------"); + List vos = new ArrayList<>(); + //获取查询部门的ids + List aimDepts = inspectionDataService.setDeptIds(answerAlarmDataDTO.getDeptId(),answerAlarmDataDTO.getIncludeChildren()); + //获取目标数据 + List list = sccAnswerAlarmService.getAimStatisticsData(answerAlarmDataDTO,aimDepts); + if (Func.isNotEmpty(list)) { + log.info("联系接警记录统计数据[{}]", list); + //赋值统计基础数据 + setBaseData(answerAlarmDataDTO, list); + //根据机构和类型分组获取统计结果值 + setResultData(vos, list); + //计算出统计值 + setTotalData(answerAlarmDataDTO, vos); + } + log.info("---------------------联系接警记录数据统计列表数据获取结束---------------------"); + return page.setRecords(vos); + } + + /** + * 计算出统计值 + */ + private void setTotalData(AnswerAlarmDataDTO answerAlarmDataDTO, List vos) { + if (Func.isNotEmpty(vos)){ + AnswerAlarmDataVO answerAlarmDataVO = new AnswerAlarmDataVO(); + answerAlarmDataVO.setBeginDate(answerAlarmDataDTO.getBeginDate()); + answerAlarmDataVO.setEndDate(answerAlarmDataDTO.getEndDate()); + answerAlarmDataVO.setType("总计"); + answerAlarmDataVO.setDeptId(null); + answerAlarmDataVO.setDeptName("总计"); + answerAlarmDataVO.setNumberOfCalls(vos.stream().mapToInt(AnswerAlarmDataVO::getNumberOfCalls).sum()); + answerAlarmDataVO.setAlarmPushNumber(vos.stream().mapToInt(AnswerAlarmDataVO::getAlarmPushNumber).sum()); + answerAlarmDataVO.setSettlementNumber(vos.stream().mapToInt(AnswerAlarmDataVO::getSettlementNumber).sum()); + answerAlarmDataVO.setAlarmPushRatio(CalculationRatioUtil.getAimRatio(answerAlarmDataVO.getAlarmPushNumber(),answerAlarmDataVO.getNumberOfCalls())); + vos.add(0,answerAlarmDataVO); + } + } + + /** + * 根据机构和类型分组获取统计结果值 + */ + private void setResultData(List vos, List list) { + Map> collect = list.stream().collect(Collectors.groupingBy(item -> item.getDeptId().concat("-").concat(item.getDeptName()).concat("-").concat(item.getType()))); + if (Func.isNotEmpty(collect)){ + collect.forEach((key,value) ->{ + AnswerAlarmDataVO vo = new AnswerAlarmDataVO(); + vo.setDeptId(key.split("-")[0]); + vo.setDeptName(key.split("-")[1]); + vo.setType(key.split("-")[2]); + vo.setBeginDate(value.get(0).getBeginDate()); + vo.setEndDate(value.get(0).getEndDate()); + vo.setSettlementNumber(value.stream().mapToInt(AnswerAlarmDataVO::getSettlementNumber).sum()); + vo.setAlarmPushNumber(value.stream().mapToInt(AnswerAlarmDataVO::getAlarmPushNumber).sum()); + vo.setNumberOfCalls(value.stream().mapToInt(AnswerAlarmDataVO::getNumberOfCalls).sum()); + vo.setAlarmPushRatio(CalculationRatioUtil.getAimRatio(vo.getAlarmPushNumber(),vo.getNumberOfCalls())); + vos.add(vo); + }); + } + } + + /** + * 赋值统计基础数据 + */ + private void setBaseData(AnswerAlarmDataDTO answerAlarmDataDTO, List list) { + list.forEach(item ->{ + item.setBeginDate(answerAlarmDataDTO.getBeginDate()); + item.setEndDate(answerAlarmDataDTO.getEndDate()); + item.setNumberOfCalls(1); + item.setAlarmPushNumber(Constant.PUSH_STATE_ONE.equals(item.getStatus()) ? 1 : 0); + item.setSettlementNumber(Constant.PUSH_STATE_TWO.equals(item.getStatus()) ? 1 : 0); + }); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/AssessmentDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/AssessmentDataServiceImpl.java new file mode 100644 index 0000000..d456017 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/AssessmentDataServiceImpl.java @@ -0,0 +1,138 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.assessment.entity.AssessmentDetail; +import org.security.trans.assessment.service.IAssessmentDetailService; +import org.security.trans.assessment.service.IAssessmentService; +import org.security.trans.dataStatistics.dto.AssessmentDataDTO; +import org.security.trans.dataStatistics.service.AssessmentDataService; +import org.security.trans.dataStatistics.util.CalculationRatioUtil; +import org.security.trans.dataStatistics.vo.AssessmentDataVO; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @since :Created in 2022/11/24 11:34 + */ +@Service +@Slf4j +@AllArgsConstructor +public class AssessmentDataServiceImpl implements AssessmentDataService { + + private final InspectionDataServiceImpl inspectionDataService; + private final IAssessmentService assessmentService; + private final IAssessmentDetailService assessmentDetailService; + + + @Override + public IPage getTableData(AssessmentDataDTO assessmentDataDTO, IPage page) { + log.info("---------------------考核评价数据统计列表数据获取开始---------------------"); + List vos = new ArrayList<>(); + //获取查询部门的ids + List aimDepts = inspectionDataService.setDeptIds(assessmentDataDTO.getEvaluated(), assessmentDataDTO.getIncludeChildren()); + //判断需要统计哪一类型的考核数据(1-机构考核统计,2-相关方考核统计,3-项目考核统计) + List aimType = new ArrayList<>(); + //获取统计数据 + List baseData = getStatisticsData(assessmentDataDTO, aimDepts, aimType); + if (Func.isNotEmpty(baseData)) { + log.info("考核评价统计数据[{}]", baseData); + //赋值统计基础值 + setBaseData(baseData); + //根据deptId和evaluatedName分组计算统计值 + setResultData(assessmentDataDTO, vos, baseData); + } + //计算出一条总计值 + setTotalData(assessmentDataDTO, vos); + log.info("---------------------考核评价数据统计列表数据获取结束---------------------"); + return page.setRecords(vos); + } + + /** + * 获取统计数据 + */ + private List getStatisticsData(AssessmentDataDTO assessmentDataDTO, List aimDepts, List aimType) { + List baseData = new ArrayList<>(); + //机构考核统计 + if (Func.isNotEmpty(assessmentDataDTO.getDataType()) && Constant.STATISTICS_ASSESSMENT_TYPE_ONE.equals(assessmentDataDTO.getDataType())) { + aimType.add(Constant.ASSESSMENT_TYPE_ONE); + aimType.add(Constant.ASSESSMENT_TYPE_TWO); + aimType.add(Constant.ASSESSMENT_TYPE_THREE); + baseData = assessmentService.getAimStatisticsData(assessmentDataDTO, aimDepts, aimType); + } + //相关方考核 + if (Func.isNotEmpty(assessmentDataDTO.getDataType()) && Constant.STATISTICS_ASSESSMENT_TYPE_TWO.equals(assessmentDataDTO.getDataType())) { + aimType.add(Constant.ASSESSMENT_TYPE_FOUR); + baseData = assessmentService.getAimStatisticsData(assessmentDataDTO, aimDepts, aimType); + } + //项目考核 + if (Func.isNotEmpty(assessmentDataDTO.getDataType()) && Constant.STATISTICS_ASSESSMENT_TYPE_THREE.equals(assessmentDataDTO.getDataType())) { + aimType.add(Constant.ASSESSMENT_TYPE_FIVE); + baseData = assessmentService.getProjectStatisticsData(assessmentDataDTO, aimType); + } + return baseData; + } + + /** + * 赋值统计基础值 + */ + private void setBaseData(List baseData) { + baseData.forEach(item -> { + item.setTotalNum(1); + List list = assessmentDetailService.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(item.getId()), AssessmentDetail::getParentId, item.getId()) + .eq(AssessmentDetail::getScoreType, "2")); + item.setProblemNum((Func.isNotEmpty(list) && list.size() > 0) ? list.size() : 0); + }); + } + + /** + * 根据deptId和evaluatedName分组计算统计值 + */ + private void setResultData(AssessmentDataDTO assessmentDataDTO, List vos, List baseData) { + Map> collect = baseData.stream().collect(Collectors.groupingBy(item -> item.getDeptId().concat("-").concat(item.getEvaluatedName()))); + if (Func.isNotEmpty(collect)) { + collect.forEach(((key, value) -> { + AssessmentDataVO assessmentDataVO = new AssessmentDataVO(); + assessmentDataVO.setBeginDate(assessmentDataDTO.getBeginDate()); + assessmentDataVO.setEndDate(assessmentDataDTO.getEndDate()); + assessmentDataVO.setDeptId(key.split("-")[0]); + assessmentDataVO.setEvaluatedName(key.split("-")[1]); + assessmentDataVO.setTotalNum(value.stream().mapToInt(AssessmentDataVO::getTotalNum).sum()); + assessmentDataVO.setProblemNum(value.stream().mapToInt(AssessmentDataVO::getProblemNum).sum()); + BigDecimal totalScore = value.stream().map(AssessmentDataVO::getFinalScore).reduce(BigDecimal.ZERO, BigDecimal::add); + assessmentDataVO.setFinalScore(totalScore); + assessmentDataVO.setAverage(CalculationRatioUtil.getAimBigDecimal(totalScore, BigDecimal.valueOf(assessmentDataVO.getTotalNum()))); + vos.add(assessmentDataVO); + })); + } + } + + /** + * 计算出一条总计值 + */ + private void setTotalData(AssessmentDataDTO assessmentDataDTO, List vos) { + if (Func.isNotEmpty(vos)) { + AssessmentDataVO vo = new AssessmentDataVO(); + vo.setBeginDate(assessmentDataDTO.getBeginDate()); + vo.setEndDate(assessmentDataDTO.getEndDate()); + vo.setEvaluatedName("总计"); + vo.setDeptId(null); + vo.setTotalNum(vos.stream().mapToInt(AssessmentDataVO::getTotalNum).sum()); + vo.setProblemNum(vos.stream().mapToInt(AssessmentDataVO::getProblemNum).sum()); + vo.setFinalScore(vos.stream().map(AssessmentDataVO::getFinalScore).reduce(BigDecimal.ZERO, BigDecimal::add)); + vo.setAverage(CalculationRatioUtil.getAimBigDecimal(vo.getFinalScore(), BigDecimal.valueOf(vo.getTotalNum()))); + vos.add(0, vo); + } + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/DeviceDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/DeviceDataServiceImpl.java new file mode 100644 index 0000000..98164c9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/DeviceDataServiceImpl.java @@ -0,0 +1,110 @@ +package org.security.trans.dataStatistics.service.impl; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.basic.service.IDeviceService; +import org.security.trans.dataStatistics.dto.DeviceDataDTO; +import org.security.trans.dataStatistics.entity.DeviceData; +import org.security.trans.dataStatistics.service.DeviceDataService; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.dataStatistics.vo.RisingSunChartDeviceVo; +import org.security.trans.dataStatistics.vo.RisingSunChartVO; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @apiNote :设备统计实现层 + * @since :Created in 2022/11/28 15:14 + */ +@Service +@Slf4j +@AllArgsConstructor +public class DeviceDataServiceImpl implements DeviceDataService { + + private final IDeviceService deviceService; + private final InspectionDataServiceImpl inspectionDataService; + + @Override + public RisingSunChartDeviceVo getRisSunChartData(DeviceDataDTO deviceDataDTO) { + ArrayList vos = new ArrayList<>(); + RisingSunChartDeviceVo risingSunChartDeviceVo = new RisingSunChartDeviceVo(); + log.info("---------------------设备统计旭日数据获取开始---------------------"); + //获取统计数据 + //获取查询部门的ids + String IncludeParam ;//设置‘是否包含子级数据’参数 + if(Func.isNotEmpty(deviceDataDTO.getIncludeChildren())){ + IncludeParam=deviceDataDTO.getIncludeChildren(); + }else{//若前端没传,默认值为 1-是 + IncludeParam = Constant.INCLUDE_CHILDREN_TYPE_ONE; + } + List aimDepts = inspectionDataService.setDeptIds(deviceDataDTO.getDeptId(),IncludeParam); + List list = deviceService.getRisSunChartData(aimDepts); + if (Func.isNotEmpty(list)) { + risingSunChartDeviceVo.setTotal(list.stream().mapToInt(DeviceData::getNum).sum()); + //找出顶级节点 + List collect = list.stream().filter(item -> "0".equals(item.getParentId())).collect(Collectors.toList()); + if (Func.isNotEmpty(collect)) { + collect.forEach(item -> { + RisingSunChartVO chartVO = new RisingSunChartVO(); + chartVO.setName(item.getName()); + chartVO.setChildren(setChildrenData(item, list)); + chartVO.setValue(Func.isNotEmpty(chartVO.getChildren()) ? chartVO.getValue() + chartVO.getChildren().stream().mapToInt(RisingSunChartVO::getValue).sum() : chartVO.getValue()); + vos.add(chartVO); + }); + } + } + risingSunChartDeviceVo.setChartData(vos); + + log.info("---------------------设备统计旭日数据获取结束---------------------"); + return risingSunChartDeviceVo; + } + + /** + * 给自己数据赋值 + * + * @param item + * @param list + * @return + */ + private List setChildrenData(DeviceData item, List list) { + List collect1 = list.stream().filter(childItem -> item.getId().equals(childItem.getParentId())).collect(Collectors.toList()); + ArrayList child = new ArrayList<>(); + if (Func.isNotEmpty(collect1)) { + collect1.forEach(device -> { + RisingSunChartVO vo = new RisingSunChartVO(); + vo.setName(device.getName()); + vo.setChildren(setChildrenData(device, list)); + vo.setValue(Func.isNotEmpty(vo.getChildren()) ? device.getNum() + vo.getChildren().stream().mapToInt(RisingSunChartVO::getValue).sum() : device.getNum()); + child.add(vo); + }); + } + return child; + } + + @Override + public List getPieDeptData(DeviceDataDTO deviceDataDTO) { + List vos = new ArrayList<>(); + log.info("---------------------设备统计 按机构分布饼图数据获取开始---------------------"); + //获取统计数据 + List list =deviceService.getPieDeptData(deviceDataDTO.getDeptId()); + if (Func.isNotEmpty(list)) { + //找出设备数不为0的机构 + List collect = list.stream().filter(item -> (item.getNum()>0)).collect(Collectors.toList()); + collect.forEach(item -> { + PieChartDataVO chartVO = new PieChartDataVO(); + chartVO.setName(item.getDeptName()); + chartVO.setValue(item.getNum()); + vos.add(chartVO); + }); + } + log.info("---------------------设备统计 按机构分布饼图数据获取结束---------------------"); + return vos; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/DeviceInspectionDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/DeviceInspectionDataServiceImpl.java new file mode 100644 index 0000000..960683c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/DeviceInspectionDataServiceImpl.java @@ -0,0 +1,125 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.alibaba.druid.sql.visitor.functions.Concat; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.basic.service.IDeviceService; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import org.security.trans.dailyDuties.service.IDeviceInspectionLineService; +import org.security.trans.dailyDuties.service.IDeviceInspectionService; +import org.security.trans.dataStatistics.dto.DeviceInspectionDataDTO; +import org.security.trans.dataStatistics.service.DeviceInspectionDataService; +import org.security.trans.dataStatistics.util.CalculationRatioUtil; +import org.security.trans.dataStatistics.vo.DeviceInspectionDataVO; +import org.security.trans.settings.service.IDeviceCategorySettingsService; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @since :Created in 2022/11/24 19:43 + */ +@Service +@Slf4j +@AllArgsConstructor +public class DeviceInspectionDataServiceImpl implements DeviceInspectionDataService { + + private final InspectionDataServiceImpl inspectionDataService; + private final IDeviceInspectionService deviceInspectionService; + private final IDeviceInspectionLineService deviceInspectionLineService; + private final IDeviceCategorySettingsService deviceCategorySettingsService; + private final IDeviceService deviceService; + + @Override + public IPage getTableData(DeviceInspectionDataDTO deviceInspectionDataDTO, IPage page) { + log.info("---------------------设备检查整改数据统计列表数据获取开始---------------------"); + List vos = new ArrayList<>(); + //获取查询部门的ids + List aimDepts = inspectionDataService.setDeptIds(deviceInspectionDataDTO.getDeptId(), deviceInspectionDataDTO.getIncludeChildren()); + //获取目标数据 + List list = deviceInspectionService.getAimStatisticsData(deviceInspectionDataDTO, aimDepts); + if (Func.isNotEmpty(list)) { + //统计基础值赋值 + setBaseData(list); + //根据机构id、机构名称、设备类型分组计算统计数据 + setResultData(deviceInspectionDataDTO, vos, list); + } + //设备类型赋值 + if (Func.isNotEmpty(vos)) { + vos.forEach(item -> { + item.setType(deviceCategorySettingsService.getById(deviceService.getById(item.getType()).getTypeId()).getName()); + }); + } + //计算出一条统计值 + setTotalData(deviceInspectionDataDTO, vos); + log.info("---------------------设备检查整改数据统计列表数据获取开始---------------------"); + return page.setRecords(vos); + } + + /** + * 统计基础值赋值 + */ + private void setBaseData(List list) { + list.forEach(item -> { + List lines = deviceInspectionLineService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(item.getId()), DeviceInspectionLine::getFormId, item.getId())); + if (Func.isNotEmpty(Func.isNotEmpty(lines) && lines.size() > 0)) { + item.setCheckNum(lines.size()); + List collect = lines.stream().filter(line -> Constant.DEVICE_PROBLEM_WARN.equals(line.getProblemLevel())).collect(Collectors.toList()); + item.setProblemNum((Func.isNotEmpty(Func.isNotEmpty(collect) && collect.size() > 0)) ? collect.size() : 0); + } else { + item.setCheckNum(0); + item.setProblemNum(0); + } + item.setRectifyNum(Constant.DEVICE_STATE_RECTIFY_OVER.equals(item.getStatus()) ? 1 : 0); + }); + } + + /** + * 根据机构id、机构名称、设备类型分组计算统计数据 + */ + private void setResultData(DeviceInspectionDataDTO deviceInspectionDataDTO, List vos, List list) { + Map> collect = list.stream().collect(Collectors.groupingBy(item -> item.getDeptId().concat("-").concat(item.getDeptName()).concat("-").concat(item.getType()))); + if (Func.isNotEmpty(collect)) { + collect.forEach((key, vale) -> { + DeviceInspectionDataVO inspectionDataVO = new DeviceInspectionDataVO(); + inspectionDataVO.setBeginDate(deviceInspectionDataDTO.getBeginDate()); + inspectionDataVO.setEndDate(deviceInspectionDataDTO.getEndDate()); + inspectionDataVO.setDeptId(key.split("-")[0]); + inspectionDataVO.setDeptName(key.split("-")[1]); + inspectionDataVO.setType(key.split("-")[2]); + inspectionDataVO.setRectifyNum(vale.stream().mapToInt(DeviceInspectionDataVO::getRectifyNum).sum()); + inspectionDataVO.setCheckNum(vale.stream().mapToInt(DeviceInspectionDataVO::getCheckNum).sum()); + inspectionDataVO.setProblemNum(vale.stream().mapToInt(DeviceInspectionDataVO::getProblemNum).sum()); + inspectionDataVO.setProblemRatio(CalculationRatioUtil.getAimRatio(inspectionDataVO.getProblemNum(), inspectionDataVO.getCheckNum())); + inspectionDataVO.setRectifyRatio(CalculationRatioUtil.getAimRatio(inspectionDataVO.getRectifyNum(), inspectionDataVO.getProblemNum())); + vos.add(inspectionDataVO); + }); + } + } + + /** + * 计算出一条统计值 + */ + private void setTotalData(DeviceInspectionDataDTO deviceInspectionDataDTO, List vos) { + if (Func.isNotEmpty(vos)) { + DeviceInspectionDataVO totalValue = new DeviceInspectionDataVO(); + totalValue.setBeginDate(deviceInspectionDataDTO.getBeginDate()); + totalValue.setDeptName("总计"); + totalValue.setType("总计"); + totalValue.setCheckNum(vos.stream().mapToInt(DeviceInspectionDataVO::getCheckNum).sum()); + totalValue.setProblemNum(vos.stream().mapToInt(DeviceInspectionDataVO::getProblemNum).sum()); + totalValue.setRectifyNum(vos.stream().mapToInt(DeviceInspectionDataVO::getRectifyNum).sum()); + totalValue.setProblemRatio(CalculationRatioUtil.getAimRatio(totalValue.getProblemNum(), totalValue.getCheckNum())); + totalValue.setRectifyRatio(CalculationRatioUtil.getAimRatio(totalValue.getRectifyNum(), totalValue.getProblemNum())); + vos.add(0, totalValue); + } + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/EduAndDrillDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/EduAndDrillDataServiceImpl.java new file mode 100644 index 0000000..2218093 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/EduAndDrillDataServiceImpl.java @@ -0,0 +1,106 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.dataStatistics.dto.EduAndDrillDataDTO; +import org.security.trans.dataStatistics.service.EduAndDrillDataService; +import org.security.trans.dataStatistics.vo.EduAndDrillDataVO; +import org.security.trans.task.service.ITaskHandinService; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @since :Created in 2022/11/23 9:59 + */ +@Service +@Slf4j +@AllArgsConstructor +public class EduAndDrillDataServiceImpl implements EduAndDrillDataService { + + private final ITaskHandinService taskHandinService; + private final InspectionDataServiceImpl inspectionDataService; + + @Override + public IPage getTableData(EduAndDrillDataDTO eduAndDrillDataDTO, IPage page) { + log.info("---------------------教育培训/应急演练数据统计列表数据获取开始---------------------"); + List vos = new ArrayList<>(); + //获取查询部门的ids + List aimDepts = inspectionDataService.setDeptIds(eduAndDrillDataDTO.getDeptId(),eduAndDrillDataDTO.getIncludeChildren()); + String aimModule = null; + //获取教育培训统计数据 + if (Constant.EDU_DATA_TYPE.equals(eduAndDrillDataDTO.getDataType())) { + aimModule = "edu"; + } + //获取应急演练统计数据 + if (Constant.DRILL_DATA_TYPE.equals(eduAndDrillDataDTO.getDataType())) { + aimModule = "drill"; + } + List list = taskHandinService.getAimStatisticsData(eduAndDrillDataDTO, aimDepts, aimModule); + //统计基础值赋值 + setBaseData(list); + //根据机构和业务类型进行分组统计 + setResultData(eduAndDrillDataDTO, vos, list); + //计算出总计记录 + setTotalData(eduAndDrillDataDTO, vos); + log.info("---------------------教育培训/应急演练数据统计列表数据获取结束---------------------"); + return page.setRecords(vos); + } + + /** + * 统计基础值赋值 + */ + private void setBaseData(List list) { + if (Func.isNotEmpty(list)) { + log.info("教育培训/应急演练统计数据[{}]", list); + list.forEach(item -> { + item.setTotalNum(1); + item.setTotalPeopleNum(Func.isNotEmpty(item.getTotalPeopleNum()) ? item.getTotalPeopleNum() : 0); + }); + } + } + + /** + * 根据机构和业务类型进行分组统计 + */ + private void setResultData(EduAndDrillDataDTO eduAndDrillDataDTO, List vos, List list) { + Map> collect = list.stream().collect(Collectors.groupingBy(item -> item.getDeptId().concat("-").concat(item.getDeptName()).concat("-").concat(item.getBusinessType()))); + if (Func.isNotEmpty(collect)) { + collect.forEach((key, value) -> { + EduAndDrillDataVO dataVO = new EduAndDrillDataVO(); + dataVO.setBeginDate(eduAndDrillDataDTO.getBeginDate()); + dataVO.setEndDate(eduAndDrillDataDTO.getEndDate()); + dataVO.setDeptId(key.split("-")[0]); + dataVO.setDeptName(key.split("-")[1]); + dataVO.setBusinessType(key.split("-")[2]); + dataVO.setTotalNum(value.stream().mapToInt(EduAndDrillDataVO::getTotalNum).sum()); + dataVO.setTotalPeopleNum(value.stream().mapToInt(EduAndDrillDataVO::getTotalPeopleNum).sum()); + vos.add(dataVO); + }); + } + } + + /** + * 计算出总计记录 + */ + private void setTotalData(EduAndDrillDataDTO eduAndDrillDataDTO, List vos) { + if (Func.isNotEmpty(vos)) { + EduAndDrillDataVO vo = new EduAndDrillDataVO(); + vo.setBeginDate(eduAndDrillDataDTO.getBeginDate()); + vo.setEndDate(eduAndDrillDataDTO.getEndDate()); + vo.setBusinessType("总计"); + vo.setDeptName("总计"); + vo.setDeptId(null); + vo.setTotalNum(vos.stream().mapToInt(EduAndDrillDataVO::getTotalNum).sum()); + vo.setTotalPeopleNum(vos.stream().mapToInt(EduAndDrillDataVO::getTotalPeopleNum).sum()); + vos.add(0, vo); + } + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/EmployeeDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/EmployeeDataServiceImpl.java new file mode 100644 index 0000000..5ba28ec --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/EmployeeDataServiceImpl.java @@ -0,0 +1,251 @@ +package org.security.trans.dataStatistics.service.impl; + +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.trans.dataStatistics.vo.HistogramDataVO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.basic.dto.EmployeeDTO; +import org.security.trans.dataStatistics.service.IEmployeeDataService; +import org.security.trans.basic.service.IEmployeeService; +import org.security.ht.vo.basic.EmployeeVO; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Create by wzf + * @date 2022/5/23 14:45 + */ +@Service +@AllArgsConstructor +public class EmployeeDataServiceImpl implements IEmployeeDataService { + + private final IEmployeeService employeeService; + + @Override + public List getSexData(EmployeeDTO employeeDTO, Query query) { + List list = getEmployeeVOList(employeeDTO); + ArrayList dataVos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getGender())).collect(Collectors.groupingBy(EmployeeVO::getGender)); + collect.forEach((key, value) -> { + PieChartDataVO pieChartDataVO = new PieChartDataVO(); + pieChartDataVO.setName(Constant.SEX_BOY.equals(key) ? "男" : "女"); + pieChartDataVO.setValue(value.size()); + dataVos.add(pieChartDataVO); + }); + } + return dataVos; + } + + /** + * 获取统计数据 + */ + private List getEmployeeVOList(EmployeeDTO employeeDTO) { + return employeeService.getEmployeeStatisticsData(employeeDTO); + } + + @Override + public List getAgeData(EmployeeDTO employeeDTO, Query query) { + List list = getEmployeeVOList(employeeDTO); + ArrayList vos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { + //没有年龄信息的 + List collectU = list.stream().filter(item -> Func.isEmpty(item.getAge())).collect(Collectors.toList()); + setData(vos, collectU, "年龄未知"); + //有年龄信息的 + List collectHasAge = list.stream().filter(item -> Func.isNotEmpty(item.getAge())).collect(Collectors.toList()); + //统计20岁以下 + List collect = collectHasAge.stream().filter(item -> Integer.parseInt(item.getAge()) < 20).collect(Collectors.toList()); + setData(vos, collect, "20岁以下"); + //统计[20-30)岁 + List collect1 = collectHasAge.stream().filter(item -> Integer.parseInt(item.getAge()) >= 20 && Integer.parseInt(item.getAge()) < 30).collect(Collectors.toList()); + setData(vos, collect1, "[20-30)"); + //统计[30-40}岁 + List collect2 = collectHasAge.stream().filter(item -> Integer.parseInt(item.getAge()) >= 30 && Integer.parseInt(item.getAge()) < 40).collect(Collectors.toList()); + setData(vos, collect2, "[30-40)"); + //统计[40-50)岁 + List collect3 = collectHasAge.stream().filter(item -> Integer.parseInt(item.getAge()) >= 40 && Integer.parseInt(item.getAge()) < 50).collect(Collectors.toList()); + setData(vos, collect3, "[40-50)"); + //50岁及以上 + List collect4 = collectHasAge.stream().filter(item -> Integer.parseInt(item.getAge()) >= 50).collect(Collectors.toList()); + setData(vos, collect4, "50岁及以上"); + + } + return vos; + } + + @Override + public List getEducateData(EmployeeDTO employeeDTO, Query query) { + List list = getEmployeeVOList(employeeDTO); + ArrayList dataVos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { + //学历不为空的 + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getEducation()) && !"未知".equals(item.getEducation())).collect(Collectors.groupingBy(EmployeeVO::getEducation)); + setPieData(dataVos, collect); + //学历为空的 + List collect1 = list.stream().filter(item -> Func.isEmpty(item.getEducation()) || "未知".equals(item.getEducation())).collect(Collectors.toList()); + setOtherData(dataVos, collect1); + } + return dataVos; + } + + /** + *分组字段为空的数据归属赋值 + */ + private void setOtherData(List dataVos, List collect1) { + PieChartDataVO vo = new PieChartDataVO(); + vo.setName("未知"); + vo.setValue(Func.isNotEmpty(collect1) ? collect1.size() : 0); + dataVos.add(vo); + } + + @Override + public List getSeniorityInEnterpriseData(EmployeeDTO employeeDTO, Query query) { + List list = getEmployeeVOList(employeeDTO); + ArrayList vos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { +// 没有相关信息的 + List collectUnknown = list.stream().filter(item -> Func.isEmpty(item.getSeniorityInEnterprise())).collect(Collectors.toList()); + setData(vos, collectUnknown, "未知"); +// 有相关信息的 + List collectHas = list.stream().filter(item -> Func.isNotEmpty(item.getSeniorityInEnterprise())).collect(Collectors.toList()); + + //统计5年以下 + List collect = collectHas.stream().filter(item -> item.getSeniorityInEnterprise() < 5).collect(Collectors.toList()); + setData(vos, collect, "5年以下"); + //统计[5-10)年 + List collect1 = collectHas.stream().filter(item -> item.getSeniorityInEnterprise() >= 5 && item.getSeniorityInEnterprise() < 10).collect(Collectors.toList()); + setData(vos, collect1, "[5-10)"); + //统计[10-20}年 + List collect2 = collectHas.stream().filter(item -> item.getSeniorityInEnterprise() >= 10 && item.getSeniorityInEnterprise() < 20).collect(Collectors.toList()); + setData(vos, collect2, "[10-20)"); + //统计[20-30)年 + List collect3 = collectHas.stream().filter(item -> item.getSeniorityInEnterprise() >= 20 && item.getSeniorityInEnterprise() < 30).collect(Collectors.toList()); + setData(vos, collect3, "[20-30)"); + //统计30年及以上 + List collect4 = collectHas.stream().filter(item -> item.getSeniorityInEnterprise() >= 30).collect(Collectors.toList()); + setData(vos, collect4, "30年及以上"); + } + return vos; + } + + @Override + public List getProfessionalLengthOfServiceData(EmployeeDTO employeeDTO, Query query) { + List list = getEmployeeVOList(employeeDTO); + ArrayList vos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { + // 没有相关信息的 + List collectUnknown = list.stream().filter(item -> Func.isEmpty(item.getProfessionalLengthOfService())).collect(Collectors.toList()); + setData(vos, collectUnknown, "未知"); +// 有相关信息的 + List collectHas = list.stream().filter(item -> Func.isNotEmpty(item.getProfessionalLengthOfService())).collect(Collectors.toList()); + + //统计5年以下 + List collect = collectHas.stream().filter(item -> item.getProfessionalLengthOfService() < 5).collect(Collectors.toList()); + setData(vos, collect, "5年以下"); + //统计[5-10)年 + List collect1 = collectHas.stream().filter(item -> item.getProfessionalLengthOfService() >= 5 && item.getProfessionalLengthOfService() < 10).collect(Collectors.toList()); + setData(vos, collect1, "[5-10)"); + //统计[10-20}年 + List collect2 = collectHas.stream().filter(item -> item.getProfessionalLengthOfService() >= 10 && item.getProfessionalLengthOfService() < 20).collect(Collectors.toList()); + setData(vos, collect2, "[10-20)"); + //统计[20-30)年 + List collect3 = collectHas.stream().filter(item -> item.getProfessionalLengthOfService() >= 20 && item.getProfessionalLengthOfService() < 30).collect(Collectors.toList()); + setData(vos, collect3, "[20-30)"); + //统计30年及以上 + List collect4 = collectHas.stream().filter(item -> item.getProfessionalLengthOfService() >= 30).collect(Collectors.toList()); + setData(vos, collect4, "30年及以上"); + } + return vos; + } + + @Override + public List getCivilAirDefenseTypeData(EmployeeDTO employeeDTO, Query query) { + List list = getEmployeeVOList(employeeDTO); + ArrayList dataVos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getCivilAirDefenseType())).collect(Collectors.groupingBy(EmployeeVO::getCivilAirDefenseType)); + setPieData(dataVos, collect); + } + return dataVos; + } + + @Override + public List getNationTypeData(EmployeeDTO employeeDTO) { + List list = getEmployeeVOList(employeeDTO); + List vos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { + //民族不为空的 + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getNation())).collect(Collectors.groupingBy(EmployeeVO::getNation)); + if (Func.isNotEmpty(collect)) { + collect.forEach((key, value) -> { + setPieChartResultData(vos, key, value); + }); + } + //民族为空的 + List collect1 = list.stream().filter(item -> Func.isEmpty(item.getNation())).collect(Collectors.toList()); + setOtherData(vos,collect1); + } + return vos; + } + + /** + * 封装饼图返回结果 + */ + private void setPieChartResultData(List vos, String key, List value) { + PieChartDataVO vo = new PieChartDataVO(); + vo.setName(key); + vo.setValue(Func.isNotEmpty(value) ? value.size() : 0); + vos.add(vo); + } + + @Override + public List getPoliticalOutlookTypeData(EmployeeDTO employeeDTO) { + List list = getEmployeeVOList(employeeDTO); + List vos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { + //政治面貌不为空 + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getPolitics())).collect(Collectors.groupingBy(EmployeeVO::getPolitics)); + if (Func.isNotEmpty(collect)) { + collect.forEach((key, value) -> { + setPieChartResultData(vos, key, value); + }); + } + //政治面貌为空 + List collect1 = list.stream().filter(item -> Func.isEmpty(item.getPolitics())).collect(Collectors.toList()); + setOtherData(vos,collect1); + } + return vos; + } + + /** + * 封装饼图返回数据 + */ + private void setPieData(ArrayList dataVos, Map> collect) { + collect.forEach((key, value) -> { + PieChartDataVO dataVO = new PieChartDataVO(); + dataVO.setName(key); + dataVO.setValue(Func.isNotEmpty(value) ? value.size() : 0); + dataVos.add(dataVO); + }); + } + + /** + * 封装返回对象 + */ + private void setData(ArrayList vos, List collect, String name) { + if(Func.isNotEmpty(collect) && collect.size()>0){ + HistogramDataVO histogramDataVO = new HistogramDataVO(); + histogramDataVO.setName(name); + histogramDataVO.setValue(collect.size()); + vos.add(histogramDataVO); + } + + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/InspectionDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/InspectionDataServiceImpl.java new file mode 100644 index 0000000..b407813 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/InspectionDataServiceImpl.java @@ -0,0 +1,151 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.dailyDuties.entity.InspectionLine; +import org.security.trans.dailyDuties.service.IInspectionLineService; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.dataStatistics.dto.InspectionDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.InspectionDataService; +import org.security.trans.dataStatistics.util.CalculationRatioUtil; +import org.security.trans.dataStatistics.vo.InspectionDataVO; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @since :Created in 2022/10/27 17:18 + */ +@Service +@Slf4j +@AllArgsConstructor +public class InspectionDataServiceImpl implements InspectionDataService { + + private final IInspectionService inspectionService; + private final IInspectionLineService inspectionLineService; + + @Override + public IPage getTableData(InspectionDataDTO inspectionDataDTO, IPage page) { + log.info("---------------------现场检查数据统计列表数据获取开始---------------------"); + List vos = new ArrayList<>(); + //不包含子级机构或不传值 + List aimDepts = setDeptIds(inspectionDataDTO.getDeptId(),inspectionDataDTO.getIncludeChildren()); + //获取目标数据 + List list = inspectionService.getStatisticsData(inspectionDataDTO, aimDepts); + if (Func.isNotEmpty(list)) { + log.info("现场检查统计明细数据[{}]",list); + //根据id分组获取每条检查记录的检查项数和异常数 + setBaseData(inspectionDataDTO, list, vos); + } + //算出一条统计值 + setTotalData(inspectionDataDTO, vos); + log.info("---------------------现场检查数据统计列表数据获取结束---------------------"); + return page.setRecords(vos); + } + + /** + * 算出一条统计值 + */ + private void setTotalData(InspectionDataDTO inspectionDataDTO, List vos) { + if (Func.isNotEmpty(vos)) { + InspectionDataVO dataVO = new InspectionDataVO(); + dataVO.setDeptName("总计"); + dataVO.setBeginDate(inspectionDataDTO.getBeginDate()); + dataVO.setEndDate(inspectionDataDTO.getEndDate()); + dataVO.setType("总计"); + calculationValue(vos, dataVO); + vos.add(0, dataVO); + } + } + + /** + * 统计基础数据赋值 + */ + private void setBaseData(InspectionDataDTO inspectionDataDTO, List list, List vos) { + Map> collect = list.stream().collect(Collectors.groupingBy(InspectionDataVO::getId)); + List baseDataList = new ArrayList<>(); + if (Func.isNotEmpty(collect)) { + collect.forEach((key, value) -> { + List inspectionLineList = inspectionLineService.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(key), InspectionLine::getFormId, key) + .eq(InspectionLine::getFlag, Constant.PROBLEM_STATE_USUUAL)); + //统计开始时间 + value.get(0).setBeginDate(inspectionDataDTO.getBeginDate()); + //统计截止时间 + value.get(0).setEndDate(inspectionDataDTO.getEndDate()); + //检查项数 + value.get(0).setCheckNum(inspectionLineList.size()); + //异常问题数 + value.get(0).setProblemNum((int) inspectionLineList.stream().filter(item -> Constant.USUAL_STATE_TURE.equals(item.getHasProblem())).count()); + //已整改数 + value.get(0).setRectifyNum((Constant.PROBLEM_STATE_SUBMIT.equals(value.get(0).getStatus()) || Constant.PROBLEM_STATE_OVERTIME_SUBMIT.equals(value.get(0).getStatus())) ? 1 : 0); + //按时整改数 + value.get(0).setRectifyOntimeNum(Constant.PROBLEM_STATE_SUBMIT.equals(value.get(0).getStatus()) ? 1 : 0); + baseDataList.addAll(value); + }); + //根据机构和检查类型分组,返回结果赋值 + setResultData(baseDataList, vos,inspectionDataDTO); + } + } + + /** + * 列表结果赋值 + */ + private void setResultData(List value, List vos,InspectionDataDTO inspectionDataDTO) { + if (Func.isNotEmpty(value)) { + Map> collect1 = value.stream().collect(Collectors.groupingBy(item -> item.getDeptId().concat("-").concat(item.getDeptName()).concat("-").concat(item.getType()))); + if (Func.isNotEmpty(collect1)) { + collect1.forEach((key1, value1) -> { + InspectionDataVO vo = new InspectionDataVO(); + vo.setDeptId(key1.split("-")[0]); + vo.setDeptName(key1.split("-")[1]); + vo.setType(key1.split("-")[2]); + vo.setBeginDate(inspectionDataDTO.getBeginDate()); + vo.setEndDate(inspectionDataDTO.getEndDate()); + calculationValue(value1, vo); + vos.add(vo); + }); + } + } + } + + /** + * 计算 + */ + private void calculationValue(List value1, InspectionDataVO vo) { + vo.setCheckNum(value1.stream().mapToInt(InspectionDataVO::getCheckNum).sum()); + vo.setProblemNum(value1.stream().mapToInt(InspectionDataVO::getProblemNum).sum()); + vo.setProblemRatio(CalculationRatioUtil.getAimRatio(vo.getProblemNum(), vo.getCheckNum())); + vo.setRectifyNum(value1.stream().mapToInt(InspectionDataVO::getRectifyNum).sum()); + vo.setRectifyRatio(CalculationRatioUtil.getAimRatio(vo.getRectifyNum(), vo.getProblemNum())); + vo.setRectifyOntimeNum(value1.stream().mapToInt(InspectionDataVO::getRectifyOntimeNum).sum()); + vo.setRectifyOntimeRatio(CalculationRatioUtil.getAimRatio(vo.getRectifyOntimeNum(), vo.getProblemNum())); + } + + /*** + * 获取查询部门的ids + */ + public List setDeptIds(String aimDeptId,String includeChildren) { + List aimDepts = new ArrayList<>(); + if (Func.isNotEmpty(aimDeptId)) { + aimDepts.add(aimDeptId); + } + //包含子级机构 + if (Constant.INCLUDE_CHILDREN_TYPE_ONE.equals(includeChildren) && Func.isNotEmpty(aimDeptId)) { + //获取子级机构id + List deptIdList = inspectionLineService.getChildrenDeptId(aimDeptId); + aimDepts.addAll(deptIdList); + } + return aimDepts; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/MaterialDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/MaterialDataServiceImpl.java new file mode 100644 index 0000000..092d882 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/MaterialDataServiceImpl.java @@ -0,0 +1,93 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.trans.dataStatistics.dto.MaterialDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.MaterialDataService; +import org.security.trans.dataStatistics.vo.MaterialDataVO; +import org.security.trans.prevent.service.IPreventMaterialService; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @since :Created in 2022/11/24 10:00 + */ +@Service +@Slf4j +@AllArgsConstructor +public class MaterialDataServiceImpl implements MaterialDataService { + + private final InspectionDataServiceImpl inspectionDataService; + private final IPreventMaterialService preventMaterialService; + + @Override + public IPage getTableData(MaterialDataDTO materialDataDTO, IPage page) { + log.info("---------------------案件材料报送数据统计列表数据获取开始---------------------"); + List vos = new ArrayList<>(); + + //获取查询部门的ids + List aimDepts = inspectionDataService.setDeptIds(materialDataDTO.getDeptId(),materialDataDTO.getIncludeChildren()); + //获取目标数据 + List list = preventMaterialService.getAimStatisticsData(materialDataDTO,aimDepts); + if (Func.isNotEmpty(list)){ + log.info("案件材料报送统计数据[{}]",list); + //统计基础数据赋值 + setBaseData(list); + //根据机构id、机构名称和类型分组得出统计值 + setResultData(materialDataDTO, vos, list); + //算出一条统计值 + setTotalValue(materialDataDTO, vos); + } + log.info("---------------------案件材料报送数据统计列表数据获取结束---------------------"); + return page.setRecords(vos); + } + + private void setBaseData(List list) { + list.forEach(item ->{ + item.setTotalNum(1); + }); + } + + /** + * 根据机构id、机构名称和类型分组得出统计值 + */ + private void setResultData(MaterialDataDTO materialDataDTO, List vos, List list) { + Map> collect = list.stream().collect(Collectors.groupingBy(item -> item.getDeptId().concat("-").concat(item.getDeptName()).concat("-").concat(item.getBusinessType()))); + if (Func.isNotEmpty(collect)){ + collect.forEach((key,value) ->{ + MaterialDataVO materialDataVO = new MaterialDataVO(); + materialDataVO.setBeginDate(materialDataDTO.getBeginDate()); + materialDataVO.setEndDate(materialDataDTO.getEndDate()); + materialDataVO.setDeptId(key.split("-")[0]); + materialDataVO.setDeptName(key.split("-")[1]); + materialDataVO.setBusinessType(key.split("-")[2]); + materialDataVO.setTotalNum(value.stream().mapToInt(MaterialDataVO::getTotalNum).sum()); + vos.add(materialDataVO); + }); + } + } + + /** + * 计算出总计值 + */ + private void setTotalValue(MaterialDataDTO materialDataDTO, List vos) { + if (Func.isNotEmpty(vos)){ + MaterialDataVO totalValue = new MaterialDataVO(); + totalValue.setBeginDate(materialDataDTO.getBeginDate()); + totalValue.setEndDate(materialDataDTO.getEndDate()); + totalValue.setDeptId(null); + totalValue.setDeptName("总计"); + totalValue.setBusinessType("总计"); + totalValue.setTotalNum(vos.stream().mapToInt(MaterialDataVO::getTotalNum).sum()); + vos.add(0,totalValue); + } + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/OutEmployeeDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/OutEmployeeDataServiceImpl.java new file mode 100644 index 0000000..cd46f2a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/OutEmployeeDataServiceImpl.java @@ -0,0 +1,161 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.common.eum.EducationEnum; +import org.security.ht.vo.basic.EmployeeVO; +import org.security.trans.dataStatistics.service.OutEmployeeDataService; +import org.security.trans.dataStatistics.vo.HistogramDataVO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.outsourcing.dto.OutEmployeeDTO; +import org.security.trans.outsourcing.entity.OutEmployee; +import org.security.trans.outsourcing.service.IOutEmployeeService; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @apiNote :外包公司员工数据统计实现类 + * @since :Created in 2022/12/2 11:34 + */ +@Service +@AllArgsConstructor +public class OutEmployeeDataServiceImpl implements OutEmployeeDataService { + + private final IOutEmployeeService outEmployeeService; + private final InspectionDataServiceImpl inspectionDataService; + + @Override + public List getSexData(OutEmployeeDTO outEmployeeDTO) { + List list = getOutEmployees(outEmployeeDTO); + ArrayList vos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getSex())).collect(Collectors.groupingBy(OutEmployee::getSex)); + if (Func.isNotEmpty(collect)) { + collect.forEach((key, value) -> { + PieChartDataVO vo = new PieChartDataVO(); + vo.setName(Constant.SEX_BOY.equals(key) ? "男" : "女"); + vo.setValue(Func.isNotEmpty(value) ? value.size() : 0); + vos.add(vo); + }); + } + } + return vos; + } + + @Override + public List getAgeData(OutEmployeeDTO outEmployeeDTO) { + List list = getOutEmployees(outEmployeeDTO); + List vos = new ArrayList<>(); + if (Func.isNotEmpty(list)) { + //没有年龄信息的 + List collectU = list.stream().filter(item -> Func.isEmpty(item.getAge())).collect(Collectors.toList()); + setData(vos, collectU, "年龄未知"); + //统计20岁以下 + List collect = list.stream().filter(item -> Func.isNotEmpty(item.getAge()) && Integer.parseInt(item.getAge()) < 20).collect(Collectors.toList()); + setData(vos, collect, "20岁以下"); + //统计[20-30)岁 + List collect1 = list.stream().filter(item -> Func.isNotEmpty(item.getAge()) && Integer.parseInt(item.getAge()) >= 20 && Integer.parseInt(item.getAge()) < 30).collect(Collectors.toList()); + setData(vos, collect1, "[20-30)"); + //统计[30-40}岁 + List collect2 = list.stream().filter(item -> Func.isNotEmpty(item.getAge()) && Integer.parseInt(item.getAge()) >= 30 && Integer.parseInt(item.getAge()) < 40).collect(Collectors.toList()); + setData(vos, collect2, "[30-40)"); + //统计[40-50)岁 + List collect3 = list.stream().filter(item -> Func.isNotEmpty(item.getAge()) && Integer.parseInt(item.getAge()) >= 40 && Integer.parseInt(item.getAge()) < 50).collect(Collectors.toList()); + setData(vos, collect3, "[40-50)"); + //50岁及以上 + List collect4 = list.stream().filter(item -> Func.isNotEmpty(item.getAge()) && Integer.parseInt(item.getAge()) >= 50).collect(Collectors.toList()); + setData(vos, collect4, "50岁及以上"); + } + return vos; + } + + /** + * 封装返回对象 + */ + private void setData(List vos, List collect, String name) { + HistogramDataVO vo = new HistogramDataVO(); + vo.setName(name); + vo.setValue(Func.isNotEmpty(collect) ? collect.size() : 0); + vos.add(vo); + } + + @Override + public List getNationTypeData(OutEmployeeDTO outEmployeeDTO) { + List aimDepts = inspectionDataService.setDeptIds(Func.notNull(outEmployeeDTO.getDeptId())?String.valueOf(outEmployeeDTO.getDeptId()):"", outEmployeeDTO.getIncludeChildren()); +// outEmployeeService.getNationTypeData(outEmployeeDTO); + List vos = new ArrayList<>(); + List list = outEmployeeService.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(outEmployeeDTO.getCompanyId()), OutEmployee::getCompanyId, outEmployeeDTO.getCompanyId()) + .in(Func.isNotEmpty(aimDepts), OutEmployee::getDeptId, aimDepts)); + if (Func.isNotEmpty(list)){ + //民族不为空 + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getNation())).collect(Collectors.groupingBy(OutEmployee::getNation)); + if (Func.isNotEmpty(collect)){ + collect.forEach((key,value) ->{ + PieChartDataVO vo = new PieChartDataVO(); + vo.setName(outEmployeeService.getDictName(key)); + vo.setValue(Func.isNotEmpty(value) ? value.size() : 0); + vos.add(vo); + }); + } + //民族为空 + List collect1 = list.stream().filter(item -> Func.isEmpty(item.getNation())).collect(Collectors.toList()); + PieChartDataVO dataVO = new PieChartDataVO(); + dataVO.setName("未知"); + dataVO.setValue(Func.isNotEmpty(collect1) ? collect1.size() : 0); + vos.add(dataVO); + } + return vos; + } + + @Override + public List getPoliticalOutlookTypeData(OutEmployeeDTO outEmployeeDTO) { + List list = getOutEmployees(outEmployeeDTO); + List vos = new ArrayList<>(); + if (Func.isNotEmpty(list)){ + //政治面貌不为空 + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getPoliticalOutlook())).collect(Collectors.groupingBy(OutEmployee::getPoliticalOutlook)); + if (Func.isNotEmpty(collect)){ + collect.forEach((key,value) ->{ + setPieChartResultData(vos,EducationEnum.parseByCode(key).getLabel(),value); + }); + } + //政治面貌为空 + List collect1 = list.stream().filter(item -> Func.isEmpty(item.getPoliticalOutlook())).collect(Collectors.toList()); + PieChartDataVO vo = new PieChartDataVO(); + vo.setName("未知"); + vo.setValue(Func.isNotEmpty(collect1) ? collect1.size() : 0); + vos.add(vo); + } + return vos; + } + + /** + * 根据查询条件查询出相关方人员数据 + * @param outEmployeeDTO + * @return + */ + private List getOutEmployees(OutEmployeeDTO outEmployeeDTO) { + List aimDepts = inspectionDataService.setDeptIds(Func.notNull(outEmployeeDTO.getDeptId())?String.valueOf(outEmployeeDTO.getDeptId()):"", outEmployeeDTO.getIncludeChildren()); + return outEmployeeService.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(outEmployeeDTO.getCompanyId()), OutEmployee::getCompanyId, outEmployeeDTO.getCompanyId()) + .in(Func.isNotEmpty(aimDepts), OutEmployee::getDeptId, aimDepts)); + } + + /** + * 封装饼图返回结果 + */ + private void setPieChartResultData(List vos, String key, List value) { + PieChartDataVO vo = new PieChartDataVO(); + vo.setName(key); + vo.setValue(Func.isNotEmpty(value) ? value.size() : 0); + vos.add(vo); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/ProjectDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/ProjectDataServiceImpl.java new file mode 100644 index 0000000..fc29511 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/ProjectDataServiceImpl.java @@ -0,0 +1,209 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.eum.ProjectNodeEnum; +import org.security.ht.vo.basic.EmployeeVO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.ProjectDataService; +import org.security.trans.dataStatistics.vo.HistogramDataVO; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.projectBudgetManagement.entity.Project; +import org.security.trans.projectBudgetManagement.entity.ProjectContract; +import org.security.trans.projectBudgetManagement.entity.ProjectPayPlan; +import org.security.trans.projectBudgetManagement.service.IProjectContractService; +import org.security.trans.projectBudgetManagement.service.IProjectPayPlanService; +import org.security.trans.projectBudgetManagement.service.IProjectService; +import org.security.trans.projectBudgetManagement.vo.ProjectVO; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @apiNote :项目管理数据统计 + * @since :Created in 2022/12/2 15:24 + */ +@Service +@Slf4j +@AllArgsConstructor +public class ProjectDataServiceImpl implements ProjectDataService { + + private final IProjectService projectService; + private final IProjectContractService projectContractService; + private final IProjectPayPlanService projectPayPlanService; + private final InspectionDataServiceImpl inspectionDataService; + + + @Override + public List getProjectTypeData(StatisticsDataDTO statisticsDataDTO) { + ArrayList vos = new ArrayList<>(); + List list = getProjectsAimData(statisticsDataDTO); + if (Func.isNotEmpty(list)) { + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getProjectType())).collect(Collectors.groupingBy(Project::getProjectType)); + if (Func.isNotEmpty(collect)) { + collect.forEach((key, value) -> { + setPieChartResultData(vos, key, value); + }); + } + } + return vos; + } + + @Override + public List getProjectNodeData(StatisticsDataDTO statisticsDataDTO) { + ArrayList vos = new ArrayList<>(); + List list = getProjectsAimData(statisticsDataDTO); + if (Func.isNotEmpty(list)) { + Map> collect = list.stream().filter(item -> Func.isNotEmpty(item.getProjectStatus())).collect(Collectors.groupingBy(Project::getProjectStatus)); + if (Func.isNotEmpty(collect)) { + collect.forEach((key, value) -> { + HistogramDataVO vo = new HistogramDataVO(); + vo.setName(ProjectNodeEnum.parseByCode(Integer.valueOf(key)).getLabel()); + vo.setValue(Func.isNotEmpty(value) ? value.size() : 0); + vos.add(vo); + }); + } + } + return vos; + } + + @Override + public List getConcatAmtData(StatisticsDataDTO statisticsDataDTO) { + ArrayList vos = new ArrayList<>(); + List list = getProjectsAimData(statisticsDataDTO); + if (Func.isNotEmpty(list)) { + List projectVOList = Func.copy(list, ProjectVO.class); + //项目合同总金额计算 单位:万元 + setConcatAmt(projectVOList); + List collect = projectVOList.stream().filter(item -> Func.isNotEmpty(item.getConcatAmtTotal()) && item.getConcatAmtTotal().compareTo(new BigDecimal(100000)) < 0).collect(Collectors.toList()); + setPieData(vos, collect,"[0,10)"); + List collect1 = projectVOList.stream().filter(item -> Func.isNotEmpty(item.getConcatAmtTotal()) && item.getConcatAmtTotal().compareTo(new BigDecimal(100000)) >= 0 && item.getConcatAmtTotal().compareTo(new BigDecimal(500000)) < 0).collect(Collectors.toList()); + setPieData(vos, collect1,"[10,50)"); + List collect2 = projectVOList.stream().filter(item -> Func.isNotEmpty(item.getConcatAmtTotal()) && item.getConcatAmtTotal().compareTo(new BigDecimal(500000)) >= 0 && item.getConcatAmtTotal().compareTo(new BigDecimal(1000000)) < 0).collect(Collectors.toList()); + setPieData(vos, collect2,"[50,100)"); + List collect3 = projectVOList.stream().filter(item -> Func.isNotEmpty(item.getConcatAmtTotal()) && item.getConcatAmtTotal().compareTo(new BigDecimal(1000000)) >= 0 && item.getConcatAmtTotal().compareTo(new BigDecimal(2000000)) < 0).collect(Collectors.toList()); + setPieData(vos, collect3,"[100,200)"); + List collect4 = projectVOList.stream().filter(item -> Func.isNotEmpty(item.getConcatAmtTotal()) && item.getConcatAmtTotal().compareTo(new BigDecimal(2000000)) >= 0).collect(Collectors.toList()); + setPieData(vos, collect4,"200以上"); + List collect5 = projectVOList.stream().filter(item -> Func.isEmpty(item.getConcatAmtTotal()) ).collect(Collectors.toList()); + setPieData(vos, collect5,"无合同信息"); + } + return vos; + } + + /** + * 合同金额分布饼图赋值 + */ + private void setPieData(ArrayList vos, List collect,String dataName) { + if (Func.isNotEmpty(collect)) { + PieChartDataVO vo = new PieChartDataVO(); + vo.setName(dataName); + vo.setValue(Func.isNotEmpty(collect) ? collect.size() : 0); + vos.add(vo); + } + } + + + /** + * 项目合同总金额计算 + */ + private void setConcatAmt(List projectVOList) { + projectVOList.forEach(item -> { + List contractList = projectContractService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(item.getId()), ProjectContract::getProjectLinkId, item.getId())); + if (Func.isNotEmpty(contractList)) { + BigDecimal concatAmt = contractList.stream().filter(concat -> Func.isNotEmpty(concat.getContractAmt())).map(ProjectContract::getContractAmt).reduce(BigDecimal.ZERO, BigDecimal::add); + item.setConcatAmtTotal(concatAmt); + } + }); + } + + @Override + public List getPayData(StatisticsDataDTO statisticsDataDTO) { + ArrayList vos = new ArrayList<>(); + List list = getProjectsAimData(statisticsDataDTO); + if (Func.isNotEmpty(list)) { + //统计基础值计算赋值 + List projectVOList = setBaseData(list); + //筛选出支付完成的项目 + setPayPlanData(vos, projectVOList, 1, "支付完成"); + //筛选出支付未完成-仅质保金待付的项目 + setPayPlanData(vos, projectVOList, 2, "仅质保金待付"); + //筛选出支付未完成-其他待付的项目 + setPayPlanData(vos, projectVOList, 3, "其他待付"); + //筛选出没有付款计划的项目 + setPayPlanData(vos, projectVOList, 4, "无付款计划"); + } + return vos; + } + + /** + * 统计基础值计算赋值 + */ + private List setBaseData(List list) { + List projectVOList = Func.copy(list, ProjectVO.class); + projectVOList.forEach(item -> { + List plans = projectPayPlanService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(item.getId()), ProjectPayPlan::getProjectLinkId, item.getId())); + //项目支付计划为空,则该项目为4-无付款计划 + if (Func.isEmpty(plans) || plans.size() == 0) { + item.setPayStatus(4); + }//项目支付计划不为空, + else { + //筛选出实际支付金额小于计划支付金额的支付计划 + List collect = plans.stream().filter(plan -> Func.isNotEmpty(plan.getActualAmt()) + && Func.isNotEmpty(plan.getPlanAmt()) + && plan.getActualAmt().compareTo(plan.getPlanAmt()) < 0).collect(Collectors.toList()); + //实际支付金额大于等于计划支付金额,该项目为支付完成状态的项目 + if (Func.isEmpty(collect) && collect.size() <= 0) { + item.setPayStatus(1); + } else { + //若项目付款计划的未支付完成记录中含有‘1-质保金付款’类型外的付款计划,则该项目归属于其他待付,反之则为仅质保金待付 + List collect1 = collect.stream().filter(item1 -> Func.isNotEmpty(item1.getType()) && !item1.getType().equals(Constant.PROJECT_PAY_PLAN_ONE)).collect(Collectors.toList()); + item.setPayStatus((Func.isNotEmpty(collect1) && collect1.size() > 0) ? 3 : 2); + } + + } + }); + return projectVOList; + } + + /** + * 付款计划饼图分类赋值 + */ + private void setPayPlanData(ArrayList vos, List projectVOList, int payStatus, String aimName) { + List voList = projectVOList.stream().filter(item -> item.getPayStatus() == payStatus).collect(Collectors.toList()); + if(Func.isNotEmpty(voList) && voList.size()>0){ + PieChartDataVO vo = new PieChartDataVO(); + vo.setName(aimName); + vo.setValue( voList.size()); + vos.add(vo); + } + + } + + + /** + * 获取项目主表统计数据 + */ + private List getProjectsAimData(StatisticsDataDTO statisticsDataDTO) { + List aimDepts = inspectionDataService.setDeptIds(statisticsDataDTO.getDeptId(), statisticsDataDTO.getIncludeChildren()); + return projectService.list(new QueryWrapper().lambda().eq(Project::getState, Constant.SUBMIT_TYPE_ONE).in(Func.isNotEmpty(aimDepts), Project::getDeptId, aimDepts)); + } + + /** + * 封装饼图返回结果 + */ + private void setPieChartResultData(List vos, String key, List value) { + PieChartDataVO vo = new PieChartDataVO(); + vo.setName("1".equals(key) ? "建设类" : "服务类"); + vo.setValue(Func.isNotEmpty(value) ? value.size() : 0); + vos.add(vo); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/RectificationNoticeServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/RectificationNoticeServiceImpl.java new file mode 100644 index 0000000..baf9874 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/RectificationNoticeServiceImpl.java @@ -0,0 +1,135 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.RectificationNoticeService; +import org.security.trans.dataStatistics.util.CalculationRatioUtil; +import org.security.trans.dataStatistics.vo.RectificationNoticeDataVO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import org.security.trans.securityCommandCenter.service.ISccUnlocaleCheckLineService; +import org.security.trans.securityCommandCenter.service.ISccUnlocaleCheckService; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @apiNote :数据统计-整改通知书-实现类 + * @since :Created in 2022/10/31 14:31 + */ +@Service +@Slf4j +@AllArgsConstructor +public class RectificationNoticeServiceImpl implements RectificationNoticeService { + + private final ISccUnlocaleCheckService sccUnlocaleCheckService; + private final ISccUnlocaleCheckLineService sccUnlocaleCheckLineService; + private final InspectionDataServiceImpl inspectionDataService; + + @Override + public IPage getTableData(StatisticsDataDTO statisticsDataDTO, IPage page) { + log.info("---------------------非现场整改通知书数据统计列表数据获取开始---------------------"); + List vos = new ArrayList<>(); + //获取查询部门的ids + List aimDepts = inspectionDataService.setDeptIds(statisticsDataDTO.getDeptId(),statisticsDataDTO.getIncludeChildren()); + //获取目标数据 + List list = sccUnlocaleCheckService.getStatisticsData(statisticsDataDTO,aimDepts); + if (Func.isNotEmpty(list)){ + log.info("非现场整改通知书统计数据[{}]",list); + //根据id分组获取每条非现场检查整改通知书的问题数和涉及机构数 + Map> collect = list.stream().collect(Collectors.groupingBy(RectificationNoticeDataVO::getId)); + if (Func.isNotEmpty(collect)){ + List baseDataList = new ArrayList<>(); + setBaseData(statisticsDataDTO, collect, baseDataList); + //根据机构和检查类型分组,返回结果赋值 + setResultData(statisticsDataDTO, baseDataList); + } + } + //算出一条统计值 + setTotalData(statisticsDataDTO, vos); + log.info("---------------------非现场整改通知书数据统计列表数据获取结束---------------------"); + return page.setRecords(vos); + } + + /** + *计算统计值 + */ + private void setTotalData(StatisticsDataDTO statisticsDataDTO, List vos) { + if (Func.isNotEmpty(vos)){ + RectificationNoticeDataVO noticeDataVO = new RectificationNoticeDataVO(); + noticeDataVO.setDeptName("总计"); + noticeDataVO.setType("总计"); + noticeDataVO.setBeginDate(statisticsDataDTO.getBeginDate()); + noticeDataVO.setEndDate(statisticsDataDTO.getEndDate()); + calculationValue(vos,noticeDataVO); + vos.add(0,noticeDataVO); + } + } + + /** + *统计基础数据赋值 + */ + private void setBaseData(StatisticsDataDTO statisticsDataDTO, Map> collect, List baseDataList) { + collect.forEach((key,value) ->{ + List sccUnlocaleCheckLineList = sccUnlocaleCheckLineService.list(new QueryWrapper().lambda() + .eq(SccUnlocaleCheckLine::getDelFlag, Constant.DELETE_FLAG_0) + .eq(Func.isNotEmpty(key),SccUnlocaleCheckLine::getFormId,key) + .eq(SccUnlocaleCheckLine::getRecFlag,Constant.PROBLEM_STATE_USUUAL)); + //统计开始时间 + value.get(0).setBeginDate(statisticsDataDTO.getBeginDate()); + //统计截止时间 + value.get(0).setEndDate(statisticsDataDTO.getEndDate()); + //问题数 + value.get(0).setProblemNum(sccUnlocaleCheckLineList.size()); + //涉及机构数 + value.get(0).setDeptNum(Func.isNotEmpty(sccUnlocaleCheckLineList) ? sccUnlocaleCheckLineList.stream().collect(Collectors.groupingBy(SccUnlocaleCheckLine::getOutletsCode)).size() : 0); + //已整改数量 + value.get(0).setRectifyNum((Constant.PROBLEM_STATE_WAIT_TWO.equals(value.get(0).getStatus()) || Constant.PROBLEM_STATE_THREE.equals(value.get(0).getStatus()) ? 1 : 0)); + //按时整改数 + value.get(0).setRectifyOntimeNum(Constant.PROBLEM_STATE_WAIT_TWO.equals(value.get(0).getStatus()) ? 1 : 0); + baseDataList.addAll(value); + }); + } + + /** + * 返回结果赋值 + */ + private void setResultData(StatisticsDataDTO statisticsDataDTO, List baseDataList) { + if (Func.isNotEmpty(baseDataList)){ + Map> collect1 = baseDataList.stream().collect(Collectors.groupingBy(item -> item.getDeptId().concat("-").concat(item.getDeptName()).concat("-").concat(item.getType()))); + if (Func.isNotEmpty(collect1)){ + collect1.forEach((key1,value1) ->{ + RectificationNoticeDataVO vo = new RectificationNoticeDataVO(); + vo.setDeptId(key1.split("-")[0]); + vo.setDeptName(key1.split("-")[1]); + vo.setType(key1.split("-")[2]); + vo.setBeginDate(statisticsDataDTO.getBeginDate()); + vo.setEndDate(statisticsDataDTO.getEndDate()); + vo.setTotalNum(value1.size()); + calculationValue(value1, vo); + }); + } + } + } + + /** + * 计算 + */ + private void calculationValue(List value1, RectificationNoticeDataVO vo) { + vo.setProblemNum(value1.stream().mapToInt(RectificationNoticeDataVO::getProblemNum).sum()); + vo.setDeptNum(value1.stream().mapToInt(RectificationNoticeDataVO::getDeptNum).sum()); + vo.setRectifyNum(value1.stream().mapToInt(RectificationNoticeDataVO::getRectifyNum).sum()); + vo.setRectifyOntimeNum(value1.stream().mapToInt(RectificationNoticeDataVO::getRectifyOntimeNum).sum()); + vo.setRectifyRatio(CalculationRatioUtil.getAimRatio(vo.getRectifyNum(),vo.getTotalNum())); + vo.setRectifyOntimeRatio(CalculationRatioUtil.getAimRatio(vo.getRectifyOntimeNum(),vo.getTotalNum())); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/RiskDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/RiskDataServiceImpl.java new file mode 100644 index 0000000..826dac9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/RiskDataServiceImpl.java @@ -0,0 +1,92 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.service.RiskDataService; +import org.security.trans.dataStatistics.vo.RiskDataVO; +import org.security.trans.prevent.service.IPreventRiskService; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @since :Created in 2022/11/24 10:30 + */ +@Service +@Slf4j +@AllArgsConstructor +public class RiskDataServiceImpl implements RiskDataService { + + private final InspectionDataServiceImpl inspectionDataService; + private final IPreventRiskService preventRiskService; + + @Override + public IPage getTableData(StatisticsDataDTO statisticsDataDTO, IPage page) { + log.info("---------------------风险提示数据统计列表数据获取开始---------------------"); + List vos = new ArrayList<>(); + //获取查询部门的ids + List aimDepts = inspectionDataService.setDeptIds(statisticsDataDTO.getDeptId(),statisticsDataDTO.getIncludeChildren()); + //获取目标数据 + List list = preventRiskService.getAimStatisticsData(statisticsDataDTO, aimDepts); + if (Func.isNotEmpty(list)) { + log.info("风险提示统计数据[{}]",list); + //赋值统计基础值 + setBaseData(list); + //根据机构id、机构名称分组计算统计数据 + setResultData(statisticsDataDTO, vos, list); + //计算出一条总计值 + setTotalData(statisticsDataDTO, vos); + } + log.info("---------------------风险提示数据统计列表数据获取结束---------------------"); + return page.setRecords(vos); + } + + /** + * 赋值统计基础值 + */ + private void setBaseData(List list) { + list.forEach(item -> { + item.setTotalNum(1); + }); + } + + /** + * 根据机构id、机构名称分组计算统计数据 + */ + private void setResultData(StatisticsDataDTO statisticsDataDTO, List vos, List list) { + Map> collect = list.stream().collect(Collectors.groupingBy(item -> item.getDeptId().concat("-").concat(item.getDeptName()))); + if (Func.isNotEmpty(collect)) { + collect.forEach((key, value) -> { + RiskDataVO riskDataVO = new RiskDataVO(); + riskDataVO.setBeginDate(statisticsDataDTO.getBeginDate()); + riskDataVO.setEndDate(statisticsDataDTO.getEndDate()); + riskDataVO.setDeptId(key.split("-")[0]); + riskDataVO.setDeptName(key.split("-")[1]); + riskDataVO.setTotalNum(value.stream().mapToInt(RiskDataVO::getTotalNum).sum()); + vos.add(riskDataVO); + }); + } + } + + /** + * 计算出一条总计值 + */ + private void setTotalData(StatisticsDataDTO statisticsDataDTO, List vos) { + if (Func.isNotEmpty(vos)) { + RiskDataVO vo = new RiskDataVO(); + vo.setBeginDate(statisticsDataDTO.getBeginDate()); + vo.setEndDate(statisticsDataDTO.getEndDate()); + vo.setDeptId(null); + vo.setDeptName("总计"); + vo.setTotalNum(vos.stream().mapToInt(RiskDataVO::getTotalNum).sum()); + vos.add(0, vo); + } + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/UnlocaleCheckDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/UnlocaleCheckDataServiceImpl.java new file mode 100644 index 0000000..d094aea --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/service/impl/UnlocaleCheckDataServiceImpl.java @@ -0,0 +1,124 @@ +package org.security.trans.dataStatistics.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.dto.UnlocaleCheckDataDTO; +import org.security.trans.dataStatistics.service.UnlocaleCheckDataService; +import org.security.trans.dataStatistics.util.CalculationRatioUtil; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import org.security.trans.securityCommandCenter.service.ISccCheckLinesService; +import org.security.trans.securityCommandCenter.service.ISccCheckService; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author :wzf + * @since :Created in 2022/10/28 17:35 + */ +@Service +@Slf4j +@AllArgsConstructor +public class UnlocaleCheckDataServiceImpl implements UnlocaleCheckDataService { + private final ISccCheckService sccCheckService; + private final ISccCheckLinesService sccCheckLinesService; + private final InspectionDataServiceImpl inspectionDataService; + + + @Override + public IPage getTableData(UnlocaleCheckDataDTO unlocaleCheckDataDTO, IPage page) { + log.info("---------------------非现场检查数据统计列表数据获取开始---------------------"); + List vos = new ArrayList<>(); + //获取查询部门的ids + List aimDepts = inspectionDataService.setDeptIds(unlocaleCheckDataDTO.getDeptId(),unlocaleCheckDataDTO.getIncludeChildren()); + //获取目标数据 + List list = sccCheckService.getAimStatisticsData(unlocaleCheckDataDTO,aimDepts); + if (Func.isNotEmpty(list)){ + log.info("非现场检查统计数据[{}]",list); + //根据id分组获取每条非现场检查记录的检查项数和异常数 + Map> collect = list.stream().collect(Collectors.groupingBy(UnlocaleCheckDataVO::getId)); + List baseDataList = new ArrayList<>(); + if (Func.isNotEmpty(collect)){ + setStatisticsBaseData(unlocaleCheckDataDTO, collect, baseDataList); + //根据机构和检查类型分组,返回结果赋值 + setResultData(vos, baseDataList,unlocaleCheckDataDTO); + } + } + log.info("---------------------非现场检查数据统计列表数据获取结束---------------------"); + //算出一条统计值 + setTotalValue(unlocaleCheckDataDTO, vos); + return page.setRecords(vos); + } + + /** + * 算出一条统计值 + */ + private void setTotalValue(UnlocaleCheckDataDTO unlocaleCheckDataDTO, List vos) { + if (Func.isNotEmpty(vos)){ + UnlocaleCheckDataVO checkDataVO = new UnlocaleCheckDataVO(); + checkDataVO.setDeptName("总计"); + checkDataVO.setCheckType("总计"); + checkDataVO.setBeginDate(unlocaleCheckDataDTO.getBeginDate()); + checkDataVO.setEndDate(unlocaleCheckDataDTO.getEndDate()); + calculationValue(vos,checkDataVO); + vos.add(0,checkDataVO); + } + } + + /** + *统计基础数据赋值 + */ + private void setStatisticsBaseData(UnlocaleCheckDataDTO unlocaleCheckDataDTO, Map> collect, List baseDataList) { + collect.forEach((key,value) ->{ + List sccCheckLinesList = sccCheckLinesService.list(new QueryWrapper().lambda() + .eq(SccCheckLines::getDelFlag, Constant.DELETE_FLAG_0) + .eq(Func.isNotEmpty(key), SccCheckLines::getFormId, key)); + //统计开始时间 + value.get(0).setBeginDate(unlocaleCheckDataDTO.getBeginDate()); + //统计截止时间 + value.get(0).setEndDate(unlocaleCheckDataDTO.getEndDate()); + //非现场检查检查项 + value.get(0).setCheckNum(sccCheckLinesList.size()); + //非现场检查异常项 + value.get(0).setProblemNum((int) sccCheckLinesList.stream().filter(item -> Constant.CHECK_STATUS_ZERO.equals(item.getCheckStatus())).count()); + baseDataList.addAll(value); + }); + } + + /** + *统计结果赋值 + */ + private void setResultData(List vos, List baseDataList,UnlocaleCheckDataDTO unlocaleCheckDataDTO) { + Map> collect1 = baseDataList.stream().collect(Collectors.groupingBy(item -> item.getDeptId().concat("-").concat(item.getDeptName()).concat("-").concat(item.getCheckType()))); + if (Func.isNotEmpty(collect1)){ + collect1.forEach((key1,value1) ->{ + UnlocaleCheckDataVO unlocaleCheckDataVO = new UnlocaleCheckDataVO(); + unlocaleCheckDataVO.setDeptId(key1.split("-")[0]); + unlocaleCheckDataVO.setDeptName(key1.split("-")[1]); + unlocaleCheckDataVO.setCheckType(key1.split("-")[2]); + unlocaleCheckDataVO.setBeginDate(unlocaleCheckDataDTO.getBeginDate()); + unlocaleCheckDataVO.setEndDate(unlocaleCheckDataDTO.getEndDate()); + calculationValue(value1, unlocaleCheckDataVO); + vos.add(unlocaleCheckDataVO); + }); + } + } + + /** + *封装计算的数值 + */ + private void calculationValue(List value1, UnlocaleCheckDataVO vo) { + vo.setCheckNum(value1.stream().mapToInt(UnlocaleCheckDataVO::getCheckNum).sum()); + vo.setProblemNum(value1.stream().mapToInt(UnlocaleCheckDataVO::getProblemNum).sum()); + vo.setProblemRatio(CalculationRatioUtil.getAimRatio(vo.getProblemNum(),vo.getCheckNum())); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/util/CalculationRatioUtil.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/util/CalculationRatioUtil.java new file mode 100644 index 0000000..3237687 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/util/CalculationRatioUtil.java @@ -0,0 +1,55 @@ +package org.security.trans.dataStatistics.util; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; + +/** + * @author :wzf + * @apiNote :百分比计算 + * @since :Created in 2022/10/31 9:51 + */ +public class CalculationRatioUtil { + + /** + * int计算 + * + * @param divisor 除数 + * @param dividend 被除数 + * @return + */ + public static String getAimRatio(int dividend, int divisor) { + String aimRatio = null; + DecimalFormat df = new DecimalFormat("0.00"); + if (dividend == 0 && divisor != 0) { + aimRatio = "0".concat("%"); + } +// 分母为0没有意义 +// if (divisor == 0) { +// aimRatio = "0".concat("%"); +// } + if (dividend != 0 && divisor != 0) { + aimRatio = df.format(((float) dividend / divisor) * 100).concat("%"); + } + return aimRatio; + } + + + /** + * BigDecimal计算 + * + * @param divisor 除数 + * @param dividend 被除数 + * @return + */ + public static BigDecimal getAimBigDecimal(BigDecimal dividend, BigDecimal divisor) { + BigDecimal aimBigDecimal = BigDecimal.ZERO; + if (divisor.compareTo(BigDecimal.ZERO) == 0) { + aimBigDecimal = dividend; + } + if ((divisor.compareTo(BigDecimal.ZERO) != 0) && (dividend.compareTo(BigDecimal.ZERO) != 0)) { + aimBigDecimal = dividend.divide(divisor).setScale(2, RoundingMode.HALF_UP); + } + return aimBigDecimal; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/AnswerAlarmDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/AnswerAlarmDataVO.java new file mode 100644 index 0000000..37745ae --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/AnswerAlarmDataVO.java @@ -0,0 +1,42 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :联系接警记录数据统计列表返回对象 + * @since :Created in 2022/11/22 15:20 + */ +@Data +public class AnswerAlarmDataVO extends StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 联系接警记录类型 + */ + private String type; + + /** + *通话数量 + */ + private int numberOfCalls; + + /** + * 办结数 + */ + private int settlementNumber; + + /** + * 警情推送数 + */ + private int alarmPushNumber; + + + /** + * 警情推送率 + */ + private String alarmPushRatio; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/AssessmentDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/AssessmentDataVO.java new file mode 100644 index 0000000..81f0a62 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/AssessmentDataVO.java @@ -0,0 +1,41 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author :wzf + * @apiNote :考核评价数据统计返回实体 + * @since :Created in 2022/11/24 11:03 + */ +@Data +public class AssessmentDataVO extends StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 被考评公司/被考评机构/被考评项目名称 + */ + private String evaluatedName; + + /** + * 累计考评次数 + */ + private int totalNum; + + /** + * 累计问题数 + */ + private int problemNum; + + /** + * 考核平均分 + */ + private BigDecimal average; + + /** + * 考核得分 + */ + private BigDecimal finalScore; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/DeviceInspectionDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/DeviceInspectionDataVO.java new file mode 100644 index 0000000..0b9140e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/DeviceInspectionDataVO.java @@ -0,0 +1,55 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :设备检查整改数据统计返回实体 + * @since :Created in 2022/11/24 17:52 + */ +@Data +public class DeviceInspectionDataVO extends StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 设备类型 + */ + private String type; + + /** + *检查项数 + */ + private int checkNum; + + /** + * 异常问题数 + */ + private int problemNum; + + /** + * 异常率 + */ + private String problemRatio; + + /** + * 已整改数 + */ + private int rectifyNum; + + /** + * 整改率 + */ + private String rectifyRatio; + + /** + * 按时整改数 + */ + private int rectifyOntimeNum; + + /** + *按时整改率 + */ + private String rectifyOntimeRatio; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/EduAndDrillDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/EduAndDrillDataVO.java new file mode 100644 index 0000000..5eaad16 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/EduAndDrillDataVO.java @@ -0,0 +1,32 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :应急演练和教育培训统计数据返回实体 + * @since :Created in 2022/11/23 9:44 + */ +@Data +public class EduAndDrillDataVO extends StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 类型 + */ + private String businessType; + + /** + * 累计演练/培训次数 + */ + private int totalNum; + + /** + *累计参与人次 + */ + private int totalPeopleNum; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/HistogramDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/HistogramDataVO.java new file mode 100644 index 0000000..56f15bf --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/HistogramDataVO.java @@ -0,0 +1,24 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author Create by wzf + * @date 2022/5/23 11:40 + * 柱状图视图层实体 + */ +@Data +public class HistogramDataVO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 属性名 + */ + private String name; + + /** + * 属性值 + */ + private Integer value; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/InspectionDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/InspectionDataVO.java new file mode 100644 index 0000000..a173442 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/InspectionDataVO.java @@ -0,0 +1,57 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author :wzf + * @apiNote :数据统计现场检查 + * @since :Created in 2022/10/27 17:03 + */ +@Data +public class InspectionDataVO extends StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 检查类型 + */ + private String type; + + /** + *检查项数 + */ + private int checkNum; + + /** + *异常问题数 + */ + private int problemNum; + + /** + *异常率 + */ + private String problemRatio; + + /** + *已整改数 + */ + private int rectifyNum; + + /** + *整改率 + */ + private String rectifyRatio; + + /** + *按时整改数 + */ + private int rectifyOntimeNum; + + /** + *按时整改率 + */ + private String rectifyOntimeRatio; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/MaterialDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/MaterialDataVO.java new file mode 100644 index 0000000..2e50955 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/MaterialDataVO.java @@ -0,0 +1,25 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :案件材料报送报表统计返回实体 + * @since :Created in 2022/11/24 9:56 + */ +@Data +public class MaterialDataVO extends StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 类型 + */ + private String businessType; + + /** + * 累计上报数量 + */ + private int totalNum; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/PieChartDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/PieChartDataVO.java new file mode 100644 index 0000000..03d1a13 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/PieChartDataVO.java @@ -0,0 +1,25 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author Create by wzf + * @date 2022/5/23 11:39 + * 饼图视图层实体 + */ +@Data +public class PieChartDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 属性名 + */ + private String name; + + /** + * 属性值 + */ + private Integer value; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RectificationNoticeDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RectificationNoticeDataVO.java new file mode 100644 index 0000000..6ba0713 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RectificationNoticeDataVO.java @@ -0,0 +1,55 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :数据统计-整改通知书返回实体 + * @since :Created in 2022/10/31 14:33 + */ +@Data +public class RectificationNoticeDataVO extends StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 检查整改通知书类型 + */ + private String type; + + /** + * 通知书数量 + */ + private int totalNum; + + /** + * 问题数 + */ + private int problemNum; + + /** + * 涉及机构数 + */ + private int deptNum; + + /** + * 已整改数 + */ + private int rectifyNum; + + /** + * 整改率 + */ + private String rectifyRatio; + + /** + * 按时整改数 + */ + private int rectifyOntimeNum; + + /** + * 按时整改率 + */ + private String rectifyOntimeRatio; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RisingSunChartDeviceVo.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RisingSunChartDeviceVo.java new file mode 100644 index 0000000..ef72e17 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RisingSunChartDeviceVo.java @@ -0,0 +1,18 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.util.List; + +/** + * @author nantian.yangzhengyu + * @date 2023/2/8 10:20 + * 设备报表-设备类型分布旭日图 含各类型设备总数 + */ +@Data +public class RisingSunChartDeviceVo { + //被查出设备总数 + private int total; + //旭日图所需data + private List chartData; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RisingSunChartVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RisingSunChartVO.java new file mode 100644 index 0000000..9feb30e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RisingSunChartVO.java @@ -0,0 +1,22 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author :wzf + * @apiNote :数据统计旭日图返回结果封装 + * @since :Created in 2022/11/28 15:05 + */ +@Data +public class RisingSunChartVO implements Serializable { + private static final long serialVersionUID = 1L; + + private String name; + + private int value; + + private List children; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RiskDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RiskDataVO.java new file mode 100644 index 0000000..330e5e8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/RiskDataVO.java @@ -0,0 +1,21 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :风险提示数据统计返回的实体 + * @since :Created in 2022/11/24 10:30 + */ +@Data +public class RiskDataVO extends StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + + /** + * 累计提报数量 + */ + private int totalNum; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/StatisticsDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/StatisticsDataVO.java new file mode 100644 index 0000000..50d3bf6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/StatisticsDataVO.java @@ -0,0 +1,53 @@ +package org.security.trans.dataStatistics.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author :wzf + * @apiNote :数据统计返回前端通用字段 + * @since :Created in 2022/10/27 16:59 + */ +@Data +public class StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 统计机构id + */ + @ApiModelProperty(value = "统计机构id") + private String deptId; + + /** + * 统计开始时间 + */ + @ApiModelProperty(value = "统计开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date beginDate; + + /** + * 统计结束时间 + */ + @ApiModelProperty(value = "统计结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endDate; + + /** + * id + */ + private String id; + + /** + * 状态 + */ + private String status; + + /** + * 机构名称 + */ + private String deptName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/UnlocaleCheckDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/UnlocaleCheckDataVO.java new file mode 100644 index 0000000..05e7612 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/dataStatistics/vo/UnlocaleCheckDataVO.java @@ -0,0 +1,34 @@ +package org.security.trans.dataStatistics.vo; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @since :Created in 2022/10/28 17:37 + */ +@Data +public class UnlocaleCheckDataVO extends StatisticsDataVO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 检查类型 + */ + private String checkType; + + /** + * 检查项数 + */ + private int checkNum; + + /** + * 异常问题数 + */ + private int problemNum; + + /** + * 异常率 + */ + private String problemRatio; +} + diff --git a/security-service/ht-security/src/main/java/org/security/trans/feign/HtClient.java b/security-service/ht-security/src/main/java/org/security/trans/feign/HtClient.java new file mode 100644 index 0000000..d05a8ed --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/feign/HtClient.java @@ -0,0 +1,79 @@ +package org.security.trans.feign; + +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +import com.baomidou.mybatisplus.extension.service.IService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.ht.feign.IHtClient; +import org.security.trans.common.service.FlowableService; +import org.security.trans.securityCommandCenter.entity.SccAnswerAlarm; +import org.security.trans.securityCommandCenter.service.ISccAlarmPushService; +import org.security.trans.securityCommandCenter.service.ISccAnswerAlarmService; +import org.security.trans.securityCommandCenter.service.ISccCheckService; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tenant.annotation.NonDS; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.SpringUtil; +import org.springframework.context.ApplicationContext; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.Map; + +/** + * @Author: chenchao + * @Create: 2022/8/26 + * @Description: + */ +@NonDS +@ApiIgnore +@RestController +@AllArgsConstructor +@Slf4j +public class HtClient implements IHtClient { + + private final ISccAnswerAlarmService sccAnswerAlarmService; + private final ISccAlarmPushService sccAlarmPushService; + private final ISccCheckService sccCheckService; + + @Override + @GetMapping(UPDATE_STATE_BY_ID) + public R updateStateById(String serviceBeanName, String id, String state) { + ApplicationContext context = SpringUtil.getContext(); + if (!context.containsBean(serviceBeanName)) { + throw new ServiceException("找不到服务实例“" + serviceBeanName + "”,请重新配置后再试!"); + } + FlowableService service = (FlowableService) context.getBean(serviceBeanName); + Boolean success = service.updateStateById(id, state); + return R.status(success); + } + + @Override + @GetMapping(SEND_ALARM_NOTICE) + public R sendAlarmNotice(String answerAlarmId) { + SccAnswerAlarm sccAnswerAlarm = sccAnswerAlarmService.getById(answerAlarmId); + boolean success = sccAlarmPushService.senAlarmNotice(sccAnswerAlarm); + return R.status(success); + } + + @Override + @GetMapping(SEND_SCC_CHECK_NOTICE) + public R sendSccCheckNotice(String sccCheckId) { + boolean success = sccCheckService.createdCheackNotice(sccCheckId); + return R.status(success); + } + + @Override + @PostMapping(AFTER_FLOW_FINISHED) + public R afterFlowFinished(String serviceBeanName, String id, Boolean pass, Map variables) { + ApplicationContext context = SpringUtil.getContext(); + if (!context.containsBean(serviceBeanName)) { + throw new ServiceException("找不到服务实例“" + serviceBeanName + "”,请重新配置后再试!"); + } + FlowableService service = (FlowableService) context.getBean(serviceBeanName); + return service.afterFlowFinished(id, pass, variables); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/feign/UserFeignClient.java b/security-service/ht-security/src/main/java/org/security/trans/feign/UserFeignClient.java new file mode 100644 index 0000000..0a3cace --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/feign/UserFeignClient.java @@ -0,0 +1,29 @@ +package org.security.trans.feign; + +import org.security.common.constant.CommonConstant; +import org.security.system.user.entity.User; +import org.security.system.user.vo.UserVO; +import org.springblade.core.tool.api.R; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +/** + * @author zj 2022/4/22 + */ +@FeignClient( + value = CommonConstant.APPLICATION_USER_NAME +) +public interface UserFeignClient { + + @GetMapping("/user/role") + R> getListByRole(@RequestParam String roleId); + + @GetMapping("/user/detail") + R getUserDetail(@RequestParam Long id); + + @GetMapping("/detail") + R detail(User user); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowDataController.java b/security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowDataController.java new file mode 100644 index 0000000..684a1d5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowDataController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.flow.entity.FlowData; +import org.security.trans.flow.vo.FlowDataVO; +import org.security.trans.flow.service.IFlowDataService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 流程-流程信息主表 控制器 + * + * @author BladeX + * @since 2022-03-29 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/flowdata") +@Api(value = "流程-流程信息主表", tags = "流程-流程信息主表接口") +public class FlowDataController extends BladeController { + + private final IFlowDataService flowDataService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入flowData") + public R detail(FlowData flowData) { + FlowData detail = flowDataService.getOne(Condition.getQueryWrapper(flowData)); + return R.data(detail); + } + + /** + * 分页 流程-流程信息主表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入flowData") + public R> list(FlowData flowData, Query query) { + IPage pages = flowDataService.page(Condition.getPage(query), Condition.getQueryWrapper(flowData)); + return R.data(pages); + } + + /** + * 自定义分页 流程-流程信息主表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入flowData") + public R> page(FlowDataVO flowData, Query query) { + IPage pages = flowDataService.selectFlowDataPage(Condition.getPage(query), flowData); + return R.data(pages); + } + + /** + * 新增 流程-流程信息主表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入flowData") + public R save(@Valid @RequestBody FlowData flowData) { + return R.status(flowDataService.save(flowData)); + } + + /** + * 修改 流程-流程信息主表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入flowData") + public R update(@Valid @RequestBody FlowData flowData) { + return R.status(flowDataService.updateById(flowData)); + } + + /** + * 新增或修改 流程-流程信息主表 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入flowData") + public R submit(@Valid @RequestBody FlowData flowData) { + return R.status(flowDataService.saveOrUpdate(flowData)); + } + + + /** + * 删除 流程-流程信息主表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(flowDataService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowHistoryController.java b/security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowHistoryController.java new file mode 100644 index 0000000..386c6bd --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowHistoryController.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.flow.dto.FlowStartDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.flow.entity.FlowHistory; +import org.security.trans.flow.vo.FlowHistoryVO; +import org.security.trans.flow.service.IFlowHistoryService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.text.ParseException; +import java.util.List; + +/** + * 流程-流程历史记录表 控制器 + * + * @author BladeX + * @since 2022-03-29 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/flow") +@Api(value = "流程-流程历史记录表", tags = "流程-流程历史记录表接口") +public class FlowHistoryController extends BladeController { + + private final IFlowHistoryService flowHistoryService; + /** + * 提报/通过 + */ + @PostMapping("/pass") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "提报/通过", notes = "传入fflowStartDTO") + public R passFlow(@Valid @RequestBody FlowStartDTO flowStartDTO){ + return flowHistoryService.approvalPassData(flowStartDTO); + } + + + /** + * 驳回 + */ + @PostMapping("/refuse") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "驳回", notes = "传入fflowStartDTO") + public R refuseFlow(@Valid @RequestBody FlowStartDTO flowStartDTO){ + return flowHistoryService.rejectData(flowStartDTO); + } + + + /** + * 获取流程历史 + */ + @GetMapping("/flow-history") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "获取流程历史", notes = "传入fflowStartDTO") + public R> getFlowHistory(@Valid @RequestBody FlowStartDTO flowStartDTO) { + return R.data(flowHistoryService.getFlowHistory(flowStartDTO)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowNodeController.java b/security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowNodeController.java new file mode 100644 index 0000000..aee96a1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/controller/FlowNodeController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.flow.entity.FlowNode; +import org.security.trans.flow.vo.FlowNodeVO; +import org.security.trans.flow.service.IFlowNodeService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 流程-流程节点表 控制器 + * + * @author BladeX + * @since 2022-03-29 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/flownode") +@Api(value = "流程-流程节点表", tags = "流程-流程节点表接口") +public class FlowNodeController extends BladeController { + + private final IFlowNodeService flowNodeService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入flowNode") + public R detail(FlowNode flowNode) { + FlowNode detail = flowNodeService.getOne(Condition.getQueryWrapper(flowNode)); + return R.data(detail); + } + + /** + * 分页 流程-流程节点表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入flowNode") + public R> list(FlowNode flowNode, Query query) { + IPage pages = flowNodeService.page(Condition.getPage(query), Condition.getQueryWrapper(flowNode)); + return R.data(pages); + } + + /** + * 自定义分页 流程-流程节点表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入flowNode") + public R> page(FlowNodeVO flowNode, Query query) { + IPage pages = flowNodeService.selectFlowNodePage(Condition.getPage(query), flowNode); + return R.data(pages); + } + + /** + * 新增 流程-流程节点表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入flowNode") + public R save(@Valid @RequestBody FlowNode flowNode) { + return R.status(flowNodeService.save(flowNode)); + } + + /** + * 修改 流程-流程节点表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入flowNode") + public R update(@Valid @RequestBody FlowNode flowNode) { + return R.status(flowNodeService.updateById(flowNode)); + } + + /** + * 新增或修改 流程-流程节点表 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入flowNode") + public R submit(@Valid @RequestBody FlowNode flowNode) { + return R.status(flowNodeService.saveOrUpdate(flowNode)); + } + + + /** + * 删除 流程-流程节点表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(flowNodeService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowDataDTO.java new file mode 100644 index 0000000..29de8d8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowDataDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.dto; + +import org.security.trans.flow.entity.FlowData; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 流程-流程信息主表数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class FlowDataDTO extends FlowData { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowHistoryDTO.java b/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowHistoryDTO.java new file mode 100644 index 0000000..d69211e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowHistoryDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.dto; + +import org.security.trans.flow.entity.FlowHistory; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 流程-流程历史记录表数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class FlowHistoryDTO extends FlowHistory { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowNodeDTO.java b/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowNodeDTO.java new file mode 100644 index 0000000..70915b0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowNodeDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.dto; + +import org.security.trans.flow.entity.FlowNode; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 流程-流程节点表数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class FlowNodeDTO extends FlowNode { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowStartDTO.java b/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowStartDTO.java new file mode 100644 index 0000000..6e071ff --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/dto/FlowStartDTO.java @@ -0,0 +1,45 @@ +package org.security.trans.flow.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author Create by wzf + * @date 2022/3/29 14:44 + */ +@Data +public class FlowStartDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 业务流程编码 + */ + @ApiModelProperty(value = "业务流程编码") + private String flowBusinessCode; + + /** + * 业务数据关联id + */ + @ApiModelProperty(value = "业务数据关联id") + private String businessLinkId; + + /** + * 审批状态 0-驳回,1-通过 + */ + @ApiModelProperty(value = "审批状态 0-驳回,1-通过") + private String approveStatus; + + /** + * 通过/驳回原因 + */ + @ApiModelProperty(value = "通过/驳回原因") + private String remarks; + + /** + * 是否为智能驳回(0-否、1-是) + */ + @ApiModelProperty(value = "是否为智能驳回(0-否、1-是)") + private String rejectFlag; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowData.java b/security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowData.java new file mode 100644 index 0000000..697c557 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowData.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 流程-流程信息主表实体类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Data +@TableName("T_FLOW_DATA") +@ApiModel(value = "FlowData对象", description = "流程-流程信息主表") +public class FlowData extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 业务流程编码 + */ + @ApiModelProperty(value = "业务流程编码") + @TableField("FLOW_BUSINESS_CODE") + private String flowBusinessCode; + /** + * 业务流程名称 + */ + @ApiModelProperty(value = "业务流程名称") + @TableField("FLOW_BUSINESS_NAME") + private String flowBusinessName; + /** + * 业务流程启用状态;0-启用,1-禁用 + */ + @ApiModelProperty(value = "业务流程启用状态;0-启用,1-禁用") + @TableField("FLOW_STATUS") + private String flowStatus; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowHistory.java b/security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowHistory.java new file mode 100644 index 0000000..20b22e6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowHistory.java @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 流程-流程历史记录表实体类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Data +@TableName("T_FLOW_HISTORY") +@ApiModel(value = "FlowHistory对象", description = "流程-流程历史记录表") +public class FlowHistory implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createdBy; + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createdTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + /** + * 更新时间 + */ + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updatedTime; + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 流程关联id + */ + @ApiModelProperty(value = "流程关联id") + @TableField("FLOW_ID") + private String flowId; + /** + * 流程节点id + */ + @ApiModelProperty(value = "流程节点id") + @TableField("FLOW_NODE_ID") + private String flowNodeId; + /** + * 流程节点名称 + */ + @ApiModelProperty(value = "流程节点名称") + @TableField("FLOW_NODE_NAME") + private String flowNodeName; + /** + * 上一节点id + */ + @ApiModelProperty(value = "上一节点id") + @TableField("PRE_NODE_ID") + private String preNodeId; + /** + * 下一节点id + */ + @ApiModelProperty(value = "下一节点id") + @TableField("NEXT_NODE_ID") + private String nextNodeId; + /** + * 角色id + */ + @ApiModelProperty(value = "角色id") + @TableField("FLOW_ROLE_ID") + private String flowRoleId; + /** + * 业务数据关联id + */ + @ApiModelProperty(value = "业务数据关联id") + @TableField("BUSINESS_LINK_ID") + private String businessLinkId; + /** + * 是否为当前节点状态;0-否,1-是 + */ + @ApiModelProperty(value = "是否为当前节点状态;0-否,1-是") + @TableField("CURRENT_NODE_FLAG") + private String currentNodeFlag; + /** + * 是否是被智能驳回后的节点(0-否,1-是) + */ + @ApiModelProperty(value = "是否是被智能驳回后的节点(0-否,1-是)") + @TableField("REFUSE_FLAG") + private String refuseFlag; + /** + * 审批状态;0-驳回,1-通过 + */ + @ApiModelProperty(value = "审批状态;0-驳回,1-通过") + @TableField("APPROVE_STATUS") + private String approveStatus; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARKS") + private String remarks; + + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowNode.java b/security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowNode.java new file mode 100644 index 0000000..0053faf --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/entity/FlowNode.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 流程-流程节点表实体类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Data +@TableName("T_FLOW_NODE") +@ApiModel(value = "FlowNode对象", description = "流程-流程节点表") +public class FlowNode extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 流程关联id + */ + @ApiModelProperty(value = "流程关联id") + @TableField("FLOW_ID") + private String flowId; + /** + * 流程节点名称 + */ + @ApiModelProperty(value = "流程节点名称") + @TableField("FLOW_NODE_NAME") + private String flowNodeName; + /** + * 上一节点id + */ + @ApiModelProperty(value = "上一节点id") + @TableField("PRE_NODE_ID") + private String preNodeId; + /** + * 下一节点id + */ + @ApiModelProperty(value = "下一节点id") + @TableField("NEXT_NODE_ID") + private String nextNodeId; + /** + * 角色id + */ + @ApiModelProperty(value = "角色id") + @TableField("FLOW_ROLE_ID") + private String flowRoleId; + /** + * 是否为流程分叉节点;0-否,1-是 + */ + @ApiModelProperty(value = "是否为流程分叉节点;0-否,1-是") + @TableField("CHILD_NODE_TYPE") + private String childNodeType; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowDataMapper.java b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowDataMapper.java new file mode 100644 index 0000000..ff459d7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowDataMapper.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.flow.entity.FlowData; +import org.security.trans.flow.vo.FlowDataVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 流程-流程信息主表 Mapper 接口 + * + * @author BladeX + * @since 2022-03-29 + */ +public interface FlowDataMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param flowData + * @return + */ + List selectFlowDataPage(IPage page, FlowDataVO flowData); + + /** + * 获取流程关联业务数据id + * @param flowBusinessCodes 业务编码 + * @return + */ + List getFlowData(@Param("flowBusinessCodes") List flowBusinessCodes); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowDataMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowDataMapper.xml new file mode 100644 index 0000000..5ea46ab --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowDataMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowHistoryMapper.java b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowHistoryMapper.java new file mode 100644 index 0000000..6908a9a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowHistoryMapper.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.flow.entity.FlowHistory; +import org.security.trans.flow.vo.FlowHistoryVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.ArrayList; +import java.util.List; + +/** + * 流程-流程历史记录表 Mapper 接口 + * + * @author BladeX + * @since 2022-03-29 + */ +public interface FlowHistoryMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param flowHistory + * @return + */ + List selectFlowHistoryPage(IPage page, FlowHistoryVO flowHistory); + + /** + * 获取流程历史数据 + * @param roleId 当前登录人角色id + * @param arrayList 流程模块id + * @return + */ + List getFlowHistoryData(@Param("roleId") String roleId, @Param("arrayList") ArrayList arrayList); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowHistoryMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowHistoryMapper.xml new file mode 100644 index 0000000..df872dc --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowHistoryMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowNodeMapper.java b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowNodeMapper.java new file mode 100644 index 0000000..dc79ccd --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowNodeMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.mapper; + +import org.security.trans.flow.entity.FlowNode; +import org.security.trans.flow.vo.FlowNodeVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 流程-流程节点表 Mapper 接口 + * + * @author BladeX + * @since 2022-03-29 + */ +public interface FlowNodeMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param flowNode + * @return + */ + List selectFlowNodePage(IPage page, FlowNodeVO flowNode); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowNodeMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowNodeMapper.xml new file mode 100644 index 0000000..48fd6d4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/mapper/FlowNodeMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowDataService.java b/security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowDataService.java new file mode 100644 index 0000000..5bd2543 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowDataService.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.service; + +import org.security.trans.flow.entity.FlowData; +import org.security.trans.flow.vo.FlowDataVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * 流程-流程信息主表 服务类 + * + * @author BladeX + * @since 2022-03-29 + */ +public interface IFlowDataService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param flowData + * @return + */ + IPage selectFlowDataPage(IPage page, FlowDataVO flowData); + + /** + * 获取流程关联业务数据id + * @param flowBusinessCodes 业务编码 + * @return + */ + List getFlowData(List flowBusinessCodes); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowHistoryService.java b/security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowHistoryService.java new file mode 100644 index 0000000..c400bc9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowHistoryService.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.service; + +import org.security.trans.flow.dto.FlowStartDTO; +import org.security.trans.flow.entity.FlowHistory; +import org.security.trans.flow.vo.FlowHistoryVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.flow.vo.FlowNodeDataVO; +import org.springblade.core.tool.api.R; + +import java.text.ParseException; +import java.util.List; + +/** + * 流程-流程历史记录表 服务类 + * + * @author BladeX + * @since 2022-03-29 + */ +public interface IFlowHistoryService extends IService { + + + /** + * 发起流程 + * @param flowStartDTO 标识数据 + * @return + * @throws ParseException + */ + boolean startFlow(FlowStartDTO flowStartDTO); + + + /** + * 审批通过 + * @param flowStartDTO 业务数据 + * @return + */ + R approvalPassData(FlowStartDTO flowStartDTO); + + /** + *提报 + * @param flowStartDTO + * @return + */ + boolean passData(FlowStartDTO flowStartDTO); + + + /** + *列表页获取数据id(模块流程标识符为空获取的是代办页的数据) + * @param flowBusinessCodes 模块流程标识符 + * @param roleId 角色id + * @return + */ + FlowNodeDataVO getRoleId(List flowBusinessCodes,String roleId); + + + + /** + * 驳回 + * @param flowStartDTO 业务数据 + * @return + */ + R rejectData(FlowStartDTO flowStartDTO); + + /** + * 获取审批流程历史 + * @param flowStartDTO 业务模块信息 + * @return + */ + List getFlowHistory(FlowStartDTO flowStartDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowNodeService.java b/security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowNodeService.java new file mode 100644 index 0000000..2128bc1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/service/IFlowNodeService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.service; + +import org.security.trans.flow.entity.FlowNode; +import org.security.trans.flow.vo.FlowNodeVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 流程-流程节点表 服务类 + * + * @author BladeX + * @since 2022-03-29 + */ +public interface IFlowNodeService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param flowNode + * @return + */ + IPage selectFlowNodePage(IPage page, FlowNodeVO flowNode); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowDataServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowDataServiceImpl.java new file mode 100644 index 0000000..c6447e4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowDataServiceImpl.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.service.impl; + +import org.security.trans.flow.entity.FlowData; +import org.security.trans.flow.vo.FlowDataVO; +import org.security.trans.flow.mapper.FlowDataMapper; +import org.security.trans.flow.service.IFlowDataService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * 流程-流程信息主表 服务实现类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Service +public class FlowDataServiceImpl extends ServiceImpl implements IFlowDataService { + + @Override + public IPage selectFlowDataPage(IPage page, FlowDataVO flowData) { + return page.setRecords(baseMapper.selectFlowDataPage(page, flowData)); + } + + @Override + public List getFlowData(List flowBusinessCodes) { + return baseMapper.getFlowData(flowBusinessCodes); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowHistoryServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowHistoryServiceImpl.java new file mode 100644 index 0000000..9d12ee6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowHistoryServiceImpl.java @@ -0,0 +1,330 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.assertj.core.util.Preconditions; +import org.security.common.Constant; +import org.security.common.util.DataFormatUtil; +import org.security.trans.flow.dto.FlowStartDTO; +import org.security.trans.flow.entity.FlowData; +import org.security.trans.flow.entity.FlowHistory; +import org.security.trans.flow.entity.FlowNode; +import org.security.trans.flow.service.IFlowDataService; +import org.security.trans.flow.service.IFlowNodeService; +import org.security.trans.flow.vo.FlowHistoryVO; +import org.security.trans.flow.mapper.FlowHistoryMapper; +import org.security.trans.flow.service.IFlowHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.flow.vo.FlowNodeDataVO; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 流程-流程历史记录表 服务实现类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Slf4j +@Service +@AllArgsConstructor +public class FlowHistoryServiceImpl extends ServiceImpl implements IFlowHistoryService { + private final IFlowDataService flowDataService; + private final IFlowNodeService flowNodeService; + + @Override + public boolean startFlow(FlowStartDTO flowStartDTO){ + log.info("==============流程创建任务开始=============="); + //查看是否存在相应的流程模块 + FlowData flowData = flowDataService.getOne(new QueryWrapper().lambda().eq(Func.isNotBlank(flowStartDTO.getFlowBusinessCode()), FlowData::getFlowBusinessCode, flowStartDTO.getFlowBusinessCode()) + .eq(FlowData::getFlowStatus, "0")); + Preconditions.checkArgument(Func.isEmpty(flowData), "该业务模块没有相关的流程配置,请联系管理员处理,业务模块名称:【】", flowStartDTO.getFlowBusinessCode()); + //获取相关流程节点信息 + List flowNodeList = flowNodeService.list(new QueryWrapper().eq("FLOW_ID", flowData.getId())); + Preconditions.checkArgument(Func.isEmpty(flowNodeList), "改业务模块没有没有相关的流程节点配置,请联系管理员处,理业务模块名称:【】", flowStartDTO.getFlowBusinessCode()); + //筛选出开始节点 + List collect = flowNodeList.stream().filter(item -> "开始".equals(item.getFlowNodeName())).collect(Collectors.toList()); + Preconditions.checkArgument(Func.isEmpty(collect), "该业务模块流程节点配置错误,请联系管理员处理,理业务模块名称:【】", flowStartDTO.getFlowBusinessCode()); + //筛选出开始节点的下一节点 + List nodeList = flowNodeList.stream().filter(item -> collect.get(0).getNextNodeId().equals(item.getId())).collect(Collectors.toList()); + Preconditions.checkArgument(Func.isEmpty(nodeList), "该业务模块流程节点配置错误,请联系管理员处理,理业务模块名称:【】", flowStartDTO.getFlowBusinessCode()); + //保存节点历史表记录 + ArrayList list = new ArrayList<>(); + //开始节点 + String currentNodeFlag = "0"; + setFlowHistory(flowStartDTO, collect, list, currentNodeFlag); + //开始节点的下一节点 + String currentNodeFlag2 = "1"; + setFlowHistory(flowStartDTO, nodeList, list, currentNodeFlag2); + boolean b = super.saveBatch(list); + Preconditions.checkArgument(!b,"创建流程失败,业务数据为:",flowStartDTO); + log.info("==============流程创建任务结束=============="); + return b; + } + + @Override + public R approvalPassData(FlowStartDTO flowStartDTO) { + log.info("==============审批通过流程开始=============="); + //获取流程历史表中是否存在目标业务模块、目标业务数据id、目标角色关联的,并且处于单前节点相关的节点数据 + FlowHistory flowHistory = super.getOne(new QueryWrapper().lambda() + .eq(Func.isNotBlank(flowStartDTO.getBusinessLinkId()), FlowHistory::getBusinessLinkId, flowStartDTO.getBusinessLinkId()) + .eq(FlowHistory::getFlowRoleId, AuthUtil.getUser().getRoleId()) + .eq(FlowHistory::getCurrentNodeFlag, "1")); + if (Func.isEmpty(flowHistory)) { + log.info("该业务数据已经被其他用户审批完成,无法再次审批"); + return R.fail("该业务数据已经被其他用户审批完成,无法再次审批"); + } + //获取下一节点信息 + FlowNode flowNode = flowNodeService.getById(flowHistory.getNextNodeId()); + if (Func.isEmpty(flowNode)) { + log.error("该业务模块审批节点配置存在问题,请联系管理员处理,业务数据为【】" + flowStartDTO); + return R.fail("该业务模块审批节点配置存在问题,请联系管理员处理,业务数据为【】" + flowStartDTO); + } + //保存新节点信息,更新之前节点数据的当前节点标识符为0 + boolean b = saveNextNodeData(flowStartDTO.getBusinessLinkId(), flowNode); + boolean b1 = updatePreNode(flowHistory, flowStartDTO); + log.info("==============审批通过流程结束=============="); + if (b && b1) { + log.info("审批通过"); + return R.success("审批通过"); + }else { + log.error("审批通过失败,业务数据为【】" + flowStartDTO); + return R.fail("审批通过失败,请联系管理员"); + } + } + + @Override + public boolean passData(FlowStartDTO flowStartDTO) { + log.info("==============任务提报流程开始=============="); + //获取流程历史表中是否存在目标业务模块、目标业务数据id、目标角色关联的,并且处于单前节点相关的提报节点数据 + FlowHistory flowHistory = super.getOne(new QueryWrapper().lambda() + .eq(Func.isNotBlank(flowStartDTO.getBusinessLinkId()), FlowHistory::getBusinessLinkId, flowStartDTO.getBusinessLinkId()) + .eq(FlowHistory::getFlowRoleId, AuthUtil.getUser().getRoleId()) + .eq(FlowHistory::getFlowNodeName, "提报") + .eq(FlowHistory::getCurrentNodeFlag, "1")); + Preconditions.checkArgument(Func.isEmpty(flowHistory), "不存在相关需要提报的业务数据,请联系管理员,业务数据为【】", flowStartDTO); + //获取下一节点信息 + FlowNode flowNode = new FlowNode(); + //当前节点是智能驳回后的节点 + if (Constant.USUAL_STATE_TURE.equals(flowHistory.getRefuseFlag())) { + //获取智能驳回后节点在流程历史表中的上一个节点 + List list = this.list(new QueryWrapper().lambda() + .eq(Func.isNotBlank(flowStartDTO.getBusinessLinkId()), FlowHistory::getBusinessLinkId, flowStartDTO.getBusinessLinkId()).orderByDesc(FlowHistory::getUpdatedTime)); + Preconditions.checkArgument(Func.isEmpty(list), "智能驳回后数据"); + //因为list按更新时间排序后第二条数据就是智能驳回节点数据 + Func.copy(list.get(1), flowNode); + } else { + flowNode = flowNodeService.getById(flowHistory.getNextNodeId()); + } + Preconditions.checkArgument(Func.isEmpty(flowNode), "该业务模块流程节点配置错误,请联系管理员,业务相关数据【】", flowStartDTO); + //保存新节点信息,更新之前节点数据的当前节点标识符为0 + boolean b = saveNextNodeData(flowStartDTO.getBusinessLinkId(), flowNode); + boolean b1 = updatePreNode(flowHistory, flowStartDTO); + log.info("==============任务提报流程结束=============="); + return b && b1; + } + + /** + * 更新之前节点数据的当前节点标识符为0 + */ + private boolean updatePreNode(FlowHistory flowHistory, FlowStartDTO flowStartDTO) { + flowHistory.setCurrentNodeFlag("0"); + flowHistory.setApproveStatus(flowStartDTO.getApproveStatus()); + flowHistory.setRemarks(flowStartDTO.getRemarks()); + return super.updateById(flowHistory); + } + + /** + * 保存新节点信息 + */ + private boolean saveNextNodeData(String dataId, FlowNode flowNode) { + FlowHistory history = Func.copy(flowNode, FlowHistory.class); + history.setId(null); + history.setFlowNodeId(flowNode.getId()); + history.setBusinessLinkId(dataId); + history.setCurrentNodeFlag("1"); + history.setRefuseFlag(Constant.USUAL_STATE_FALSE); + return super.save(history); + } + + @Override + public FlowNodeDataVO getRoleId(List flowBusinessCodes, String roleId) { + log.info("==============获取流程是否处于单前节点的业务关联数据id集合开始=============="); + FlowNodeDataVO nodeDataVO = new FlowNodeDataVO(); + //模块流程标识符不为空 + if (Func.isNotEmpty(flowBusinessCodes)) { + //获取流程模块id + ArrayList arrayList = new ArrayList<>(); + List flowData = flowDataService.getFlowData(flowBusinessCodes); + if (Func.isNotEmpty(flowData)) { + flowData.forEach(item -> { + arrayList.add(item.getId()); + }); + } + //获取流程历史表数据 + List flowHistoryList = baseMapper.getFlowHistoryData(roleId, arrayList); + if (Func.isNotEmpty(flowHistoryList)) { + setDataId(nodeDataVO, flowHistoryList); + } + } else { + //模块流程标识符为空 + List historyList = super.list(new QueryWrapper().eq("FLOW_ROLE_ID", roleId)); + setDataId(nodeDataVO, historyList); + } + log.info("==============获取流程是否处于单前节点的业务关联数据id集合结束=============="); + return nodeDataVO; + } + + /** + * 设置返回数据id + */ + private void setDataId(FlowNodeDataVO nodeDataVO, List flowHistoryList) { + //当前节点并且是提报节点数据id + List currDataIdList = flowHistoryList.stream().filter(item -> "1".equals(item.getCurrentNodeFlag()) && "提报".equals(item.getFlowNodeName())).collect(Collectors.toList()); + //当前节点并且不是提报节点数据id + List currList = flowHistoryList.stream().filter(item -> "1".equals(item.getCurrentNodeFlag()) && !"提报".equals(item.getFlowNodeName())).collect(Collectors.toList()); + //筛选出不处于当前节点的数据id + List dataIdList = flowHistoryList.stream().filter(item -> "0".equals(item.getCurrentNodeFlag())).collect(Collectors.toList()); + if (Func.isNotEmpty(currDataIdList)) { + ArrayList currIdList = new ArrayList<>(); + currDataIdList.forEach(item -> { + currIdList.add(item.getBusinessLinkId()); + }); + //list去重 + ArrayList stringArrayList = setDataIdList(currIdList); + nodeDataVO.setCurrDataList(stringArrayList); + } + if (Func.isNotEmpty(currList)) { + ArrayList curr = new ArrayList<>(); + currList.forEach(item -> { + curr.add(item.getBusinessLinkId()); + }); + ArrayList stringArrayList = setDataIdList(curr); + nodeDataVO.setCurrList(stringArrayList); + } + if (Func.isNotEmpty(dataIdList)) { + ArrayList idList = new ArrayList<>(); + dataIdList.forEach(item -> { + idList.add(item.getBusinessLinkId()); + }); + //list去重 + ArrayList stringArrayList = setDataIdList(idList); + nodeDataVO.setDataIdList(stringArrayList); + } + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public R rejectData(FlowStartDTO flowStartDTO){ + log.info("==============业务流程驳回开始=============="); + FlowHistory flowHistory = super.getOne(new QueryWrapper().lambda() + .eq(Func.isNotBlank(flowStartDTO.getBusinessLinkId()), FlowHistory::getBusinessLinkId, flowStartDTO.getBusinessLinkId()) + .eq(FlowHistory::getFlowRoleId, AuthUtil.getUser().getRoleId()) + .eq(FlowHistory::getCurrentNodeFlag, "1")); + if (Func.isEmpty(flowHistory)) { + log.info("该业务已经被驳回,请勿重复提交驳回操作,驳回申请数据为【】" + flowStartDTO); + return R.fail(409, "该业务已经被驳回,请勿重复提交驳回操作"); + } + //获取提报节点 + FlowNode flowNode = flowNodeService.getOne(new QueryWrapper().lambda() + .eq(Func.isNotBlank(flowHistory.getFlowId()), FlowNode::getFlowId, flowHistory.getFlowId()) + .eq(FlowNode::getFlowNodeName, "提报")); + if (Func.isEmpty(flowNode)) { + log.info("任务驳回失败,该业务流程节点配置存在问题,请联系管理员,驳回申请数据为【】" + flowStartDTO); + return R.fail(410, "任务驳回失败,该业务流程节点配置存在问题,请联系管理员"); + } + //将流程历史表里业务数据id对应的最新当前节点数据更新为提报节点 + boolean b = saveNodeData(flowStartDTO, flowNode); + //更新之前节点数据的当前节点标识符为非当前节点 + boolean b1 = updatePreNode(flowHistory, flowStartDTO); + log.info("==============业务流程驳回结束=============="); + if (b && b1){ + log.info("任务驳回成功"); + return R.success("任务驳回成功"); + }else { + log.info("任务驳回失败,请联系管理员,驳回申请数据为【】" + flowStartDTO); + return R.success("任务驳回失败"); + } + } + + @Override + public List getFlowHistory(FlowStartDTO flowStartDTO) { + log.info("==============获取业务流程历史开始=============="); + List flowHistoryList = this.list(new QueryWrapper().lambda() + .eq(Func.isNotBlank(flowStartDTO.getBusinessLinkId()), FlowHistory::getBusinessLinkId, flowStartDTO.getBusinessLinkId())); + List flowHistoryVOS = Func.copy(flowHistoryList, FlowHistoryVO.class); + log.info("==============获取业务流程历史结束=============="); + return flowHistoryVOS; + } + + /** + *将流程历史表里业务数据id对应的最新当前节点数据更新为提报节点 + */ + private boolean saveNodeData(FlowStartDTO flowStartDTO, FlowNode flowNode) { + FlowHistory history = Func.copy(flowNode, FlowHistory.class); + history.setId(""); + history.setCurrentNodeFlag("1"); + history.setFlowNodeId(flowNode.getId()); + history.setRemarks(flowStartDTO.getRemarks()); + history.setApproveStatus(flowStartDTO.getApproveStatus()); + history.setBusinessLinkId(flowStartDTO.getBusinessLinkId()); + history.setRefuseFlag(Constant.USUAL_STATE_FALSE.equals(flowStartDTO.getRejectFlag()) ? Constant.USUAL_STATE_FALSE : Constant.USUAL_STATE_TURE); + return this.save(history); + } + + /** + * list去重 + */ + private ArrayList setDataIdList(ArrayList currIdList) { + HashSet set = new HashSet<>(); + ArrayList stringArrayList = new ArrayList<>(); + currIdList.forEach(item -> { + if (set.add(item)) { + stringArrayList.add(item); + } + }); + return stringArrayList; + } + + /** + * 设置流程历史数据 + */ + private void setFlowHistory(FlowStartDTO flowStartDTO, List collect, ArrayList list, String currentNodeFlag){ + FlowHistory flowHistory = Func.copy(collect.get(0), FlowHistory.class); + flowHistory.setId(null); + flowHistory.setRefuseFlag(Constant.USUAL_STATE_FALSE); + flowHistory.setFlowNodeId(collect.get(0).getId()); + flowHistory.setBusinessLinkId(flowStartDTO.getBusinessLinkId()); + flowHistory.setCurrentNodeFlag(currentNodeFlag); + list.add(flowHistory); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowNodeServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowNodeServiceImpl.java new file mode 100644 index 0000000..4a8b191 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/service/impl/FlowNodeServiceImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.service.impl; + +import org.security.trans.flow.entity.FlowNode; +import org.security.trans.flow.vo.FlowNodeVO; +import org.security.trans.flow.mapper.FlowNodeMapper; +import org.security.trans.flow.service.IFlowNodeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 流程-流程节点表 服务实现类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Service +public class FlowNodeServiceImpl extends ServiceImpl implements IFlowNodeService { + + @Override + public IPage selectFlowNodePage(IPage page, FlowNodeVO flowNode) { + return page.setRecords(baseMapper.selectFlowNodePage(page, flowNode)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowDataVO.java new file mode 100644 index 0000000..412ed2d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowDataVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.vo; + +import org.security.trans.flow.entity.FlowData; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 流程-流程信息主表视图实体类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "FlowDataVO对象", description = "流程-流程信息主表") +public class FlowDataVO extends FlowData { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowHistoryVO.java b/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowHistoryVO.java new file mode 100644 index 0000000..179656f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowHistoryVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.vo; + +import org.security.trans.flow.entity.FlowHistory; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 流程-流程历史记录表视图实体类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "FlowHistoryVO对象", description = "流程-流程历史记录表") +public class FlowHistoryVO extends FlowHistory { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowNodeDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowNodeDataVO.java new file mode 100644 index 0000000..a3fd75c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowNodeDataVO.java @@ -0,0 +1,36 @@ +package org.security.trans.flow.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author Create by wzf + * @date 2022/3/29 15:31 + */ +@Data +public class FlowNodeDataVO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当前节点并且是提报节点数据id + */ + @ApiModelProperty(value = "当前节点并且是提报节点数据id") + private List currDataList; + + + /** + * 当前节点但不是提报节点数据id + */ + @ApiModelProperty(value = "当前节点但不是提报节点数据id") + private List currList; + + /** + * 历史节点数据id + */ + @ApiModelProperty(value = "历史节点数据id") + private List dataIdList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowNodeVO.java b/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowNodeVO.java new file mode 100644 index 0000000..fa990ef --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/flow/vo/FlowNodeVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.flow.vo; + +import org.security.trans.flow.entity.FlowNode; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 流程-流程节点表视图实体类 + * + * @author BladeX + * @since 2022-03-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "FlowNodeVO对象", description = "流程-流程节点表") +public class FlowNodeVO extends FlowNode { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/README.md b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/README.md new file mode 100644 index 0000000..2c51295 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/README.md @@ -0,0 +1 @@ +## 业务外包模块 \ No newline at end of file diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutCompanyController.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutCompanyController.java new file mode 100644 index 0000000..ece3433 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutCompanyController.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.validation.Valid; + +import org.security.trans.outsourcing.dto.OutCompanyDTO; +import org.security.trans.outsourcing.entity.OutCompany; +import org.security.trans.outsourcing.service.IOutCompanyService; +import org.security.trans.outsourcing.vo.OutCompanyVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.boot.ctrl.BladeController; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.List; + +/** + * 外包公司表 控制器 + * + * @author BladeX + * @since 2022-02-21 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/outsourcing") +@Api(value = "外包公司", tags = "外包公司接口") +public class OutCompanyController extends BladeController { + + private final IOutCompanyService outCompanyService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + OutCompanyVO detail = outCompanyService.getDetail(id); + return R.data(detail); + } + + /** + * 分页 外包公司表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入outCompany") + public R> list(OutCompanyDTO outCompany, Query query) { + IPage pages = outCompanyService.selectOutCompanyPage(Condition.getPage(query), outCompany); + return R.data(pages); + } + + /** + * 新增 外包公司表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入outCompany") + public R save(@Valid @RequestBody OutCompanyVO outCompanyVO){ + return R.status(outCompanyService.saveOutCompany(outCompanyVO)); + } + + /** + * 修改 外包公司表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入outCompany") + public R update(@Valid @RequestBody OutCompanyVO outCompanyVO){ + return R.status(outCompanyService.updateOutCompany(outCompanyVO)); + } + + /** + * 新增或修改 外包公司表 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入outCompany") + public R submit(@Valid @RequestBody OutCompanyVO outCompanyVO) { + return R.status(outCompanyService.saveOrUpdate(Func.convert(outCompanyVO,OutCompany.class))); + } + + + /** + * 删除 外包公司表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return outCompanyService.removeCompanys(Func.toLongList(ids)); + } + + + /** + * 获取外包公司信息 + */ + @GetMapping("/data") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "获取外包公司信息", notes = "") + public R> getOutCompany() { + return R.data(outCompanyService.getOutCompany()); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeController.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeController.java new file mode 100644 index 0000000..740885a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeController.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.validation.Valid; + +import lombok.extern.slf4j.Slf4j; +import org.security.trans.outsourcing.dto.OutEmployeeDTO; +import org.security.trans.outsourcing.entity.OutEmployee; +import org.security.trans.outsourcing.service.IOutEmployeeService; +import org.security.trans.outsourcing.vo.OutEmployeeVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.boot.ctrl.BladeController; + +import java.util.Objects; + +/** + * 外包员工信息表 控制器 + * + * @author BladeX + * @since 2022-02-22 + */ +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping("/outemployee") +@Api(value = "外包员工信息表", tags = "外包员工信息表接口") +public class OutEmployeeController extends BladeController { + + private final IOutEmployeeService outEmployeeService; + + @PostMapping("/upload") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "上传") + public R upload() { + return R.success("操作成功"); + } + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(outEmployeeService.getEmployeeAndFamilyesAndJobRecords(id)); + } + + /** + * 分页 外包员工信息表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入outEmployee") + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + public R> list(OutEmployeeDTO outEmployeeDTO, Query query) { + IPage pages = outEmployeeService.getPage(query,outEmployeeDTO); + return R.data(pages); + } + + /** + * 保存 外包员工信息表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "保存", notes = "传入outEmployee") + public R save(@Valid @RequestBody OutEmployeeDTO employee) { + return R.status(outEmployeeService.saveEmployeeAndFamilyesAndJobRecords(employee)); + } + + /** + * 修改 外包员工信息表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "修改", notes = "传入outEmployee") + public R update(@Valid @RequestBody OutEmployeeDTO employee) { + return R.status(outEmployeeService.updateEmployeeAndFamilyesAndJobRecords(employee)); + } + + /** + * 删除 外包员工信息表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(outEmployeeService.removeEmployeeAndFamilyesAndJobRecords(Func.toLongList(ids))); + } + + @GetMapping("/detail/{idCard}") + public R getDetail(@PathVariable String idCard) { + OutEmployee outEmployee = outEmployeeService.getOne(new QueryWrapper().eq("id_card", idCard)); + if (Objects.isNull(outEmployee)) { + return R.fail("未查询到员工"); + } + return R.data(BeanUtil.copy(outEmployee, OutEmployeeVO.class)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeFamilyController.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeFamilyController.java new file mode 100644 index 0000000..5d4542a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeFamilyController.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.outsourcing.entity.OutEmployeeFamily; +import org.security.trans.outsourcing.service.IOutEmployeeFamilyService; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 外包员工家庭成员表 控制器 + * + * @author BladeX + * @since 2022-02-22 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/outemployeefamily") +@Api(value = "外包员工家庭成员表", tags = "外包员工家庭成员表接口") +public class OutEmployeeFamilyController extends BladeController { + + private final IOutEmployeeFamilyService outEmployeeFamilyService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入outEmployeeFamily") + public R detail(OutEmployeeFamily outEmployeeFamily) { + OutEmployeeFamily detail = outEmployeeFamilyService.getOne(Condition.getQueryWrapper(outEmployeeFamily)); + return R.data(detail); + } + + /** + * 分页 外包员工家庭成员表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入outEmployeeFamily") + public R> list(OutEmployeeFamily outEmployeeFamily, Query query) { + IPage pages = outEmployeeFamilyService.page(Condition.getPage(query), Condition.getQueryWrapper(outEmployeeFamily)); + return R.data(pages); + } + + /** + * 新增 外包员工家庭成员表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入outEmployeeFamily") + public R save(@Valid @RequestBody OutEmployeeFamily outEmployeeFamily) { + return R.status(outEmployeeFamilyService.save(outEmployeeFamily)); + } + + /** + * 修改 外包员工家庭成员表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入outEmployeeFamily") + public R update(@Valid @RequestBody OutEmployeeFamily outEmployeeFamily) { + return R.status(outEmployeeFamilyService.updateById(outEmployeeFamily)); + } + + /** + * 新增或修改 外包员工家庭成员表 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入outEmployeeFamily") + public R submit(@Valid @RequestBody OutEmployeeFamily outEmployeeFamily) { + return R.status(outEmployeeFamilyService.saveOrUpdate(outEmployeeFamily)); + } + + + /** + * 删除 外包员工家庭成员表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(outEmployeeFamilyService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeJobRecordController.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeJobRecordController.java new file mode 100644 index 0000000..483e14e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/controller/OutEmployeeJobRecordController.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.outsourcing.entity.OutEmployeeJobRecord; +import org.security.trans.outsourcing.service.IOutEmployeeJobRecordService; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 外包员工工作履历表 控制器 + * + * @author BladeX + * @since 2022-02-22 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/outemployeejobrecord") +@Api(value = "外包员工工作履历表", tags = "外包员工工作履历表接口") +public class OutEmployeeJobRecordController extends BladeController { + + private final IOutEmployeeJobRecordService outEmployeeJobRecordService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入outEmployeeJobRecord") + public R detail(OutEmployeeJobRecord outEmployeeJobRecord) { + OutEmployeeJobRecord detail = outEmployeeJobRecordService.getOne(Condition.getQueryWrapper(outEmployeeJobRecord)); + return R.data(detail); + } + + /** + * 分页 外包员工工作履历表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入outEmployeeJobRecord") + public R> list(OutEmployeeJobRecord outEmployeeJobRecord, Query query) { + IPage pages = outEmployeeJobRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(outEmployeeJobRecord)); + return R.data(pages); + } + + /** + * 新增 外包员工工作履历表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入outEmployeeJobRecord") + public R save(@Valid @RequestBody OutEmployeeJobRecord outEmployeeJobRecord) { + return R.status(outEmployeeJobRecordService.save(outEmployeeJobRecord)); + } + + /** + * 修改 外包员工工作履历表 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入outEmployeeJobRecord") + public R update(@Valid @RequestBody OutEmployeeJobRecord outEmployeeJobRecord) { + return R.status(outEmployeeJobRecordService.updateById(outEmployeeJobRecord)); + } + + /** + * 新增或修改 外包员工工作履历表 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入outEmployeeJobRecord") + public R submit(@Valid @RequestBody OutEmployeeJobRecord outEmployeeJobRecord) { + return R.status(outEmployeeJobRecordService.saveOrUpdate(outEmployeeJobRecord)); + } + + + /** + * 删除 外包员工工作履历表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(outEmployeeJobRecordService.removeByIds(Func.toLongList(ids))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutCompanyDTO.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutCompanyDTO.java new file mode 100644 index 0000000..e6f8a70 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutCompanyDTO.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.dto; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.outsourcing.entity.OutCompany; + +import java.util.List; + +/** + * 外包公司表数据传输对象实体类 + * + * @author BladeX + * @since 2022-02-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class OutCompanyDTO extends OutCompany { + private static final long serialVersionUID = 1L; + /** + * 资质及其他相关附件 + */ + private List qualificationsList; + /** + * 营业执照 + */ + private List licenseList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeDTO.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeDTO.java new file mode 100644 index 0000000..0ed56a2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeDTO.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.dto; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.outsourcing.entity.OutEmployee; +import org.security.trans.outsourcing.vo.OutEmployeeFamilyVO; +import org.security.trans.outsourcing.vo.OutEmployeeJobRecordVO; + +import java.util.List; + +/** + * 外包员工信息表数据传输对象实体类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class OutEmployeeDTO extends OutEmployee { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "家庭成员") + private List familyes; + + @ApiModelProperty(value = "工作履历") + private List jobRecords; + /** + * 相关附件 + */ + private List relevantAttachments; + /** + * 证件照附件 + */ + private List picList; + /** + * 身份证正面照附件 + */ + private List idCardFrontList; + /** + * 身份证反面照附件 + */ + private List idCardBackList; + /** + * 统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级) + */ + @ApiModelProperty(value = "统计机构是否包含子级机构数据(0-仅本级,1-本级及所属下级)") + private String includeChildren; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeFamilyDTO.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeFamilyDTO.java new file mode 100644 index 0000000..f3b8bc1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeFamilyDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.dto; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.outsourcing.entity.OutEmployeeFamily; + +/** + * 外包员工家庭成员表数据传输对象实体类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class OutEmployeeFamilyDTO extends OutEmployeeFamily { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeJobRecordDTO.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeJobRecordDTO.java new file mode 100644 index 0000000..8b40b85 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/dto/OutEmployeeJobRecordDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.dto; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.outsourcing.entity.OutEmployeeJobRecord; + +/** + * 外包员工工作履历表数据传输对象实体类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class OutEmployeeJobRecordDTO extends OutEmployeeJobRecord { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutCompany.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutCompany.java new file mode 100644 index 0000000..ca84f33 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutCompany.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 外包公司表实体类 + * + * @author BladeX + * @since 2022-02-21 + */ +@Data +@TableName("T_OUT_COMPANY") +@ApiModel(value = "OutCompany对象", description = "外包公司表") +public class OutCompany extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 上级机构代码 + */ + @ApiModelProperty(value = "上级机构代码") + @TableField("SUPPER_ORGANIZATION_CODE") + private String supperOrganizationCode; + /** + * 上级机构名称 + */ + @ApiModelProperty(value = "上级机构名称") + @TableField("SUPPER_ORGANIZATION_NAME") + private String supperOrganizationName; + /** + * 外包公司名称 + */ + @ApiModelProperty(value = "外包公司名称") + @TableField("OUT_COMPANY_NAME") + private String outCompanyName; + /** + * 业务范围及资质 + */ + @ApiModelProperty(value = "业务范围及资质") + @TableField("BUSINESS_SCOPE") + private String businessScope; + /** + * 公司简介 + */ + @ApiModelProperty(value = "公司简介") + @TableField("COMPANY_PROFILE") + private String companyProfile; + /** + * 公司地址 + */ + @ApiModelProperty(value = "公司地址") + @TableField("COMPANY_ADDRESS") + private String companyAddress; + /** + * 公司负责人姓名 + */ + @ApiModelProperty(value = "公司负责人姓名") + @TableField("COMPANY_LEADER_NAME") + private String companyLeaderName; + /** + * 公司负责人电话 + */ + @ApiModelProperty(value = "公司负责人电话") + @TableField("COMPANY_LEADER_TEL") + private String companyLeaderTel; + /** + * 业务负责人姓名 + */ + @ApiModelProperty(value = "业务负责人姓名") + @TableField("BUSINESS_LEADER_NAME") + private String businessLeaderName; + /** + * 业务负责人电话 + */ + @ApiModelProperty(value = "业务负责人电话") + @TableField("BUSINESS_LEADER_TEL") + private String businessLeaderTel; + /** + * 其他 + */ + @ApiModelProperty(value = "其他") + @TableField("OTHER_DATA") + private String otherData; + + @TableField("DEPT_ID") + private Long deptId; + + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;1-删除,0-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + @ApiModelProperty(value = "公司规模") + @TableField("SCALE") + private String scale; + + @ApiModelProperty(value = "成立时间") + @TableField("CREATED_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createdDate; + + @ApiModelProperty(value = "附件") + @TableField("FILE_IDS") + private String fileIds; + + @ApiModelProperty(value = "营业执照附件groupname") + @TableField("GROUP_NAME_LICENSE") + private String groupNameLicense; + + @ApiModelProperty(value = "资质附件groupname") + @TableField("GROUP_NAME_QUALIFICATIONS") + private String groupNameQualifications; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployee.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployee.java new file mode 100644 index 0000000..de8c98b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployee.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.entity.common.BaseEntity; + +import java.io.Serializable; +import java.util.Date; + +/** + * 外包员工信息表实体类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Data +@TableName("T_OUT_EMPLOYEE") +@ApiModel(value = "OutEmployee对象", description = "外包员工信息表") +public class OutEmployee extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 外包公司ID + */ + @ApiModelProperty(value = "外包公司ID") + @TableField("COMPANY_ID") + private String companyId; + + @TableField("NAME") + private String name; + /** + * 性别 + */ + @ApiModelProperty(value = "性别") + @TableField("SEX") + private String sex; + /** + * 年龄 + */ + @ApiModelProperty(value = "年龄") + @TableField("AGE") + private String age; + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + @TableField("ID_CARD") + private String idCard; + /** + * 民族 + */ + @ApiModelProperty(value = "民族") + @TableField("NATION") + private String nation; + /** + * 出生日期 + */ + @ApiModelProperty(value = "出生日期") + @TableField("BRITH_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date brithDate; + /** + * 政治面貌 + */ + @ApiModelProperty(value = "政治面貌") + @TableField("POLITICAL_OUTLOOK") + private String politicalOutlook; + /** + * 参加工作日期 + */ + @ApiModelProperty(value = "参加工作日期") + @TableField("WORKING_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date workingDate; + /** + * 专业技术职称 + */ + @ApiModelProperty(value = "专业技术职称") + @TableField("PROFESSIONAL_TECHNICAL_TITLES") + private String professionalTechnicalTitles; + /** + * 所在部门 + */ + @ApiModelProperty(value = "所在部门") + @TableField("COMPANY_DEPT") + private String companyDept; + /** + * 岗位名称 + */ + @ApiModelProperty(value = "岗位名称") + @TableField("POST_NAME") + private String postName; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + @TableField("TELEPHONE") + private String telephone; + /** + * 工作单位 + */ + @ApiModelProperty(value = "工作单位") + @TableField("WORK_UNIT") + private String workUnit; + /** + * 详细地址 + */ + @ApiModelProperty(value = "详细地址") + @TableField("ADDRESS") + private String address; + + @ApiModelProperty(value = "身份证正面") + @TableField("FRONT_URL") + private String frontUrl; + + @ApiModelProperty(value = "身份证反面") + @TableField("BACK_URL") + private String backUrl; + + @TableField("DEPT_ID") + private Long deptId; + /** + * 相关附件 + */ + @ApiModelProperty(value = "相关附件") + @TableField("FILE_IDS") + private String fileIds; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value ="逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + + private String delFlag; + @ApiModelProperty(value = "证件照groupname") + @TableField("GROUP_NAME_head") + private String groupNameHead; + + @ApiModelProperty(value = "身份证正面照groupname") + @TableField("GROUP_NAME_FRONT") + private String groupNameFront; + + @ApiModelProperty(value = "身份证背面照groupname") + @TableField("GROUP_NAME_BACK") + private String groupNameBack; + + @ApiModelProperty(value = "附件groupname") + @TableField("GROUP_NAME") + private String groupName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployeeFamily.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployeeFamily.java new file mode 100644 index 0000000..d3c5eb2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployeeFamily.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 外包员工家庭成员表实体类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Data +@TableName("T_OUT_FAMILY") +@ApiModel(value = "OutEmployeeFamily对象", description = "外包员工家庭成员表") +public class OutEmployeeFamily extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 外包员工ID + */ + @ApiModelProperty(value = "外包员工ID") + @TableField("EMPLOYEE_ID") + private String employeeId; + /** + * 姓名 + */ + @ApiModelProperty(value = "姓名") + @TableField("NAME") + private String name; + /** + * 与户主关系 + */ + @ApiModelProperty(value = "与户主关系") + @TableField("RELATIONSHIP") + private String relationship; + /** + * 出生日期 + */ + @ApiModelProperty(value = "出生日期") + @TableField("BRITH_DATE") + private Date brithDate; + /** + * 性别 + */ + @ApiModelProperty(value = "性别") + @TableField("SEX") + private String sex; + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + @TableField("IDCard") + private String IDCard; + /** + * 工作单位 + */ + @ApiModelProperty(value = "工作单位") + @TableField("WORK_UNIT") + private String workUnit; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + @TableField("TELEPHONE") + private String telephone; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployeeJobRecord.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployeeJobRecord.java new file mode 100644 index 0000000..8a84e32 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/entity/OutEmployeeJobRecord.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 外包员工工作履历表实体类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Data +@TableName("T_OUT_JOB_RECORD") +@ApiModel(value = "OutEmployeeJobRecord对象", description = "外包员工工作履历表") +public class OutEmployeeJobRecord extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 外包员工ID + */ + @ApiModelProperty(value = "外包员工ID") + @TableField("EMPLOYEE_ID") + private String employeeId; + /** + * 工作起始日期 + */ + @ApiModelProperty(value = "工作起始日期") + @TableField("WORK_START_DATE") + private Date workStartDate; + /** + * 工作终止日期 + */ + @ApiModelProperty(value = "工作终止日期") + @TableField("WORK_END_DATE") + private Date workEndDate; + /** + * 工作单位 + */ + @ApiModelProperty(value = "工作单位") + @TableField("WORK_UNIT") + private String workUnit; + /** + * 岗位或主要从事工作 + */ + @ApiModelProperty(value = "岗位或主要从事工作") + @TableField("JOB_CONTENT") + private String jobContent; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutCompanyMapper.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutCompanyMapper.java new file mode 100644 index 0000000..821c947 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutCompanyMapper.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.mapper; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.security.trans.assessment.entity.Assessment; +import org.security.trans.outsourcing.dto.OutCompanyDTO; +import org.security.trans.outsourcing.entity.OutCompany; +import org.security.trans.outsourcing.entity.OutEmployee; +import org.security.trans.outsourcing.vo.OutCompanyVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 外包公司表 Mapper 接口 + * + * @author BladeX + * @since 2022-02-21 + */ +public interface OutCompanyMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param outCompany + * @return + */ +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectOutCompanyPage(IPage page, @Param("outCompany") OutCompanyDTO outCompany); + + /** + * 获取所有的外包公司名称和id + * @param wrapper + * @return + */ +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + @Select("SELECT * FROM T_OUT_COMPANY ${ew.customSqlSegment}") + List getOutCompany(@Param(Constants.WRAPPER) LambdaQueryWrapper wrapper); + + List selectOutEmployees(@Param("cmpId") String cmpId); + List selectOutCompanyAssessment(@Param("cmpId") String cmpId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutCompanyMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutCompanyMapper.xml new file mode 100644 index 0000000..2e898dd --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutCompanyMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeFamilyMapper.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeFamilyMapper.java new file mode 100644 index 0000000..50d91f1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeFamilyMapper.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.outsourcing.entity.OutEmployeeFamily; +import org.security.trans.outsourcing.vo.OutEmployeeFamilyVO; + +import java.util.List; + +/** + * 外包员工家庭成员表 Mapper 接口 + * + * @author BladeX + * @since 2022-02-22 + */ +public interface OutEmployeeFamilyMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param outEmployeeFamily + * @return + */ + List selectOutEmployeeFamilyPage(IPage page, OutEmployeeFamilyVO outEmployeeFamily); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeFamilyMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeFamilyMapper.xml new file mode 100644 index 0000000..674c08c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeFamilyMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeJobRecordMapper.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeJobRecordMapper.java new file mode 100644 index 0000000..f503197 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeJobRecordMapper.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.outsourcing.entity.OutEmployeeJobRecord; +import org.security.trans.outsourcing.vo.OutEmployeeJobRecordVO; + +import java.util.List; + +/** + * 外包员工工作履历表 Mapper 接口 + * + * @author BladeX + * @since 2022-02-22 + */ +public interface OutEmployeeJobRecordMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param outEmployeeJobRecord + * @return + */ + List selectOutEmployeeJobRecordPage(IPage page, OutEmployeeJobRecordVO outEmployeeJobRecord); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeJobRecordMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeJobRecordMapper.xml new file mode 100644 index 0000000..0ccef65 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeJobRecordMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeMapper.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeMapper.java new file mode 100644 index 0000000..9e090d4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeMapper.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.outsourcing.dto.OutEmployeeDTO; +import org.security.trans.outsourcing.entity.OutEmployee; +import org.security.trans.outsourcing.vo.OutEmployeeVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 外包员工信息表 Mapper 接口 + * + * @author BladeX + * @since 2022-02-22 + */ +public interface OutEmployeeMapper extends BaseMapper { + + /** + * 获取外包人员列表信息 + * @param page + * @param outEmployeeDTO + * @return + */ +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") +// @Select("SELECT * FROM T_OUT_EMPLOYEE ${ew.customSqlSegment}") + List selectPageData(Page page, @Param("outEmployeeDTO") OutEmployeeDTO outEmployeeDTO); + + /** + * 获取外包人员民族信息 + * + * @param outEmployeeDTO 检索条件 + * @return 外包人员信息 + */ + List getNationTypeData(@Param("outEmployeeDTO") OutEmployeeDTO outEmployeeDTO); + + String getDictName(@Param("key") String key); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeMapper.xml new file mode 100644 index 0000000..7cb03ff --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/mapper/OutEmployeeMapper.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutCompanyService.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutCompanyService.java new file mode 100644 index 0000000..faa4931 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutCompanyService.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.outsourcing.dto.OutCompanyDTO; +import org.security.trans.outsourcing.entity.OutCompany; +import org.security.trans.outsourcing.vo.OutCompanyVO; +import org.springblade.core.tool.api.R; + +import java.text.ParseException; +import java.util.List; + +/** + * 外包公司表 服务类 + * + * @author BladeX + * @since 2022-02-21 + */ +public interface IOutCompanyService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param outCompany + * @return + */ + IPage selectOutCompanyPage(IPage page, OutCompanyDTO outCompany); + + /** + * 新增外包公司信息 + * @param outCompanyVO 外包公司信息 + * @return + */ + boolean saveOutCompany(OutCompanyVO outCompanyVO); + + /** + * 修改外包公司信息 + * @param outCompanyVO 外包公司信息 + * @return + */ + boolean updateOutCompany(OutCompanyVO outCompanyVO); + + /** + * 获取所以外包公司的名称和id + * @return + */ + List getOutCompany(); + /** + * 获取外包公司详情 + * @return + */ + OutCompanyVO getDetail(String id); + /** + * 删除设备 + */ + R removeCompanys(List ids); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeFamilyService.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeFamilyService.java new file mode 100644 index 0000000..58c4843 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeFamilyService.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.outsourcing.entity.OutEmployeeFamily; +import org.security.trans.outsourcing.vo.OutEmployeeFamilyVO; + +import java.util.List; + +/** + * 外包员工家庭成员表 服务类 + * + * @author BladeX + * @since 2022-02-22 + */ +public interface IOutEmployeeFamilyService extends IService { + + List getByEmployeeId(String employeeId); + + boolean removeByEmployeeId(List ids); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeJobRecordService.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeJobRecordService.java new file mode 100644 index 0000000..d244b73 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeJobRecordService.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.outsourcing.entity.OutEmployeeJobRecord; +import org.security.trans.outsourcing.vo.OutEmployeeJobRecordVO; + +import java.util.List; + +/** + * 外包员工工作履历表 服务类 + * + * @author BladeX + * @since 2022-02-22 + */ +public interface IOutEmployeeJobRecordService extends IService { + + List getByEmployeeId(String employeeId); + + boolean removeByEmployeeId(List ids); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeService.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeService.java new file mode 100644 index 0000000..4bbfe88 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/IOutEmployeeService.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.service; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.outsourcing.dto.OutEmployeeDTO; +import org.security.trans.outsourcing.entity.OutEmployee; +import org.security.trans.outsourcing.vo.OutEmployeeVO; +import org.springblade.core.mp.support.Query; + +import java.util.List; + +/** + * 外包员工信息表 服务类 + * + * @author BladeX + * @since 2022-02-22 + */ +public interface IOutEmployeeService extends IService { + IPage getPage(Query query, OutEmployeeDTO outEmployeeDto); + + /** + * 保存员工信息、员工家庭成员、员工工作履历 + * + * @param employeeDTO + * @return + */ + boolean saveEmployeeAndFamilyesAndJobRecords(OutEmployeeDTO employeeDTO); + + /** + * 查询员工、家庭成员、工作履历 + * + * @param employeeId 员工ID + * @return + */ + OutEmployeeVO getEmployeeAndFamilyesAndJobRecords(String employeeId); + + /** + * 修改员工,家庭成员,工作履历 + * + * @param employeeDTO + * @return + */ + boolean updateEmployeeAndFamilyesAndJobRecords(OutEmployeeDTO employeeDTO); + + /** + * 删除员工,家庭成员,工作履历 + * + * @param ids + * @return + */ + boolean removeEmployeeAndFamilyesAndJobRecords(List ids); + + /** + * 获取外包人员民族信息 + * + * @param outEmployeeDTO 检索条件 + * @return 外包人员信息 + */ + List getNationTypeData(OutEmployeeDTO outEmployeeDTO); + + /** + * 获取民族对应的字典name值 + * @param key 民族字典code + */ + String getDictName(String key); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutCompanyServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutCompanyServiceImpl.java new file mode 100644 index 0000000..66faebf --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutCompanyServiceImpl.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.assessment.entity.Assessment; +import org.security.trans.basic.service.IDepartmentService; +import org.security.ht.vo.basic.DeptDataVO; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.outsourcing.dto.OutCompanyDTO; +import org.security.trans.outsourcing.entity.OutCompany; +import org.security.trans.outsourcing.entity.OutEmployee; +import org.security.trans.outsourcing.mapper.OutCompanyMapper; +import org.security.trans.outsourcing.service.IOutCompanyService; +import org.security.trans.outsourcing.vo.OutCompanyVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +import static org.security.common.Constant.DELETE_FLAG_0; + +/** + * 外包公司表 服务实现类 + * + * @author BladeX + * @since 2022-02-21 + */ +@Service +@Slf4j +@AllArgsConstructor +public class OutCompanyServiceImpl extends ServiceImpl implements IOutCompanyService { + private final IDepartmentService departmentService; + private final IFileService fileService; + + @Override + public IPage selectOutCompanyPage(IPage page, OutCompanyDTO outCompany) { +// List collect = Arrays.stream(outCompany.getSupperOrganizationName().split(",")).collect(Collectors.toList()); +// outCompany.setSupperOrganizationCode(collect.get(collect.size() - 1)); + List vos = baseMapper.selectOutCompanyPage(page,outCompany); + if(vos.size()>0){ + vos.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + return page.setRecords(vos); + } + + @Override + public boolean saveOutCompany(OutCompanyVO outCompanyVO){ + OutCompany outCompany = setOutCompany(outCompanyVO); + DeptDataVO department = departmentService.getDepartmentById(Long.valueOf(AuthUtil.getDeptId())); + outCompany.setSupperOrganizationCode(String.valueOf(AuthUtil.getDeptId())); + outCompany.setSupperOrganizationName(department.getFullName()); + outCompany.setDelFlag(Constant.DELETE_FLAG_0); + this.save(outCompany); + List fileList = outCompanyVO.getFileList(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, outCompany.getId()); + } + List licenseList = outCompanyVO.getLicenseList(); + if (Objects.nonNull(licenseList) && !licenseList.isEmpty()) { + fileService.saveAttachments(licenseList, outCompany.getId()); + } + List qualificationsList = outCompanyVO.getQualificationsList(); + if (Objects.nonNull(qualificationsList) && !qualificationsList.isEmpty()) { + fileService.saveAttachments(qualificationsList, outCompany.getId()); + } + return true; + } + + private OutCompany setOutCompany(OutCompanyVO outCompanyVO) { + OutCompany outCompany = Func.copy(outCompanyVO, OutCompany.class); + outCompany.setDeptId(Long.parseLong(AuthUtil.getDeptId())); + return outCompany; + } + + @Override + public boolean updateOutCompany(OutCompanyVO outCompanyVO){ + List fileList = outCompanyVO.getFileList(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, outCompanyVO.getId()); + } + List licenseList = outCompanyVO.getLicenseList(); + if (Objects.nonNull(licenseList) && !licenseList.isEmpty()) { + fileService.saveAttachments(licenseList, outCompanyVO.getId()); + } + List qualificationsList = outCompanyVO.getQualificationsList(); + if (Objects.nonNull(qualificationsList) && !qualificationsList.isEmpty()) { + fileService.saveAttachments(qualificationsList, outCompanyVO.getId()); + } + return this.updateById(outCompanyVO); + } + + @Override + public List getOutCompany() { + LambdaQueryWrapper wrapper = new QueryWrapper().lambda().eq(OutCompany::getDelFlag, DELETE_FLAG_0); + return baseMapper.getOutCompany(wrapper); + } + + @Override + public OutCompanyVO getDetail(String id) { + OutCompany detail = this.getById(id); + //获取营业执照附件 + List licenseList = fileService.getAttachments(id,detail.getGroupNameLicense()); + //获取资质和其他附件 + List quaList = fileService.getAttachments(id,detail.getGroupNameQualifications()); + OutCompanyVO outCompanyVO = Func.copy(detail, OutCompanyVO.class); + outCompanyVO.setLicenseList(licenseList); + outCompanyVO.setQualificationsList(quaList); + return outCompanyVO; + } + + @Override + public R removeCompanys(List toLongList) { + if (Func.isNotEmpty(toLongList)) { + toLongList.forEach(item -> { + String companyId = String.valueOf(item); + //查询该公司相关的未删除的人员 + List outEmployeeList = baseMapper.selectOutEmployees(companyId); + if(outEmployeeList.size()>0){ + log.info("=====相关方【{}】存在人员信息,无法删除",item); + throw new ServiceException("当前相关方存在人员信息,无法删除"); + } + //查询该公司相关的未删除的考评记录 + List assessmentList = baseMapper.selectOutCompanyAssessment(companyId); + if(assessmentList.size()>0){ + log.info("=====相关方【{}】存在考核评价记录,无法删除",item); + throw new ServiceException("当前相关方存在考核评价记录,无法删除"); + } + }); + } + return R.status(this.removeByIds(toLongList)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeFamilyServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeFamilyServiceImpl.java new file mode 100644 index 0000000..1cf13d5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeFamilyServiceImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.outsourcing.entity.OutEmployeeFamily; +import org.security.trans.outsourcing.mapper.OutEmployeeFamilyMapper; +import org.security.trans.outsourcing.service.IOutEmployeeFamilyService; +import org.security.trans.outsourcing.vo.OutEmployeeFamilyVO; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 外包员工家庭成员表 服务实现类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Service +public class OutEmployeeFamilyServiceImpl extends ServiceImpl implements IOutEmployeeFamilyService { + + @Override + public List getByEmployeeId(String employeeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("EMPLOYEE_ID", employeeId); + List outEmployeeFamilies = baseMapper.selectList(queryWrapper); + List vos = Func.copy(outEmployeeFamilies, OutEmployeeFamilyVO.class); + return vos.isEmpty() ? Collections.emptyList() : vos; + } + + @Override + public boolean removeByEmployeeId(List ids) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("EMPLOYEE_ID", ids); + return baseMapper.delete(queryWrapper) > 0; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeJobRecordServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeJobRecordServiceImpl.java new file mode 100644 index 0000000..f9ece44 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeJobRecordServiceImpl.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.outsourcing.entity.OutEmployeeJobRecord; +import org.security.trans.outsourcing.mapper.OutEmployeeJobRecordMapper; +import org.security.trans.outsourcing.service.IOutEmployeeJobRecordService; +import org.security.trans.outsourcing.vo.OutEmployeeJobRecordVO; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 外包员工工作履历表 服务实现类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Service +public class OutEmployeeJobRecordServiceImpl extends ServiceImpl implements IOutEmployeeJobRecordService { + @Override + public List getByEmployeeId(String employeeId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("EMPLOYEE_ID", employeeId); + List outEmployeeJobRecords = baseMapper.selectList(queryWrapper); + List vos = Func.copy(outEmployeeJobRecords, OutEmployeeJobRecordVO.class); + return vos.isEmpty() ? Collections.emptyList() : vos; + } + + @Override + public boolean removeByEmployeeId(List ids) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("EMPLOYEE_ID", ids); + return baseMapper.delete(queryWrapper) > 0; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeServiceImpl.java new file mode 100644 index 0000000..fc94b78 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/service/impl/OutEmployeeServiceImpl.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.service.impl; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.common.service.IFileService; +import org.security.trans.dataStatistics.vo.PieChartDataVO; +import org.security.trans.outsourcing.dto.OutEmployeeDTO; +import org.security.trans.outsourcing.entity.OutEmployee; +import org.security.trans.outsourcing.entity.OutEmployeeFamily; +import org.security.trans.outsourcing.entity.OutEmployeeJobRecord; +import org.security.trans.outsourcing.mapper.OutEmployeeMapper; +import org.security.trans.outsourcing.service.IOutCompanyService; +import org.security.trans.outsourcing.service.IOutEmployeeFamilyService; +import org.security.trans.outsourcing.service.IOutEmployeeJobRecordService; +import org.security.trans.outsourcing.service.IOutEmployeeService; +import org.security.trans.outsourcing.vo.OutEmployeeFamilyVO; +import org.security.trans.outsourcing.vo.OutEmployeeJobRecordVO; +import org.security.trans.outsourcing.vo.OutEmployeeVO; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +import static org.security.common.Constant.*; + +/** + * 外包员工信息表 服务实现类 + * + * @author BladeX + * @since 2022-02-22 + */ +@AllArgsConstructor +@Service +public class OutEmployeeServiceImpl extends ServiceImpl implements IOutEmployeeService { + + private final IOutEmployeeFamilyService outEmployeeFamilyService; + private final IOutEmployeeJobRecordService outEmployeeJobRecordService; + private final IOutCompanyService outCompanyService; + private final IFileService fileService; + + @Override + public IPage getPage(Query query, OutEmployeeDTO outEmployeeDTO) { + Page page = new Page<>(query.getCurrent(), query.getSize()); + List list = baseMapper.selectPageData(page, outEmployeeDTO); + if (Func.isNotEmpty(list)){ + list.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + if(Func.isNotEmpty(item.getCompanyId())){ + item.setCompanyName(outCompanyService.getById(item.getCompanyId()).getOutCompanyName()); + } + if (SEX_BOY.equals(item.getSex())){ + item.setSex("男"); + } + if (SEX_GIRL.equals(item.getSex())){ + item.setSex("女"); + } + }); + } + return page.setRecords(list); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean removeEmployeeAndFamilyesAndJobRecords(List ids) { + this.removeByIds(ids); + outEmployeeFamilyService.removeByEmployeeId(ids); + outEmployeeJobRecordService.removeByEmployeeId(ids); + return true; + } + + @Override + public List getNationTypeData(OutEmployeeDTO outEmployeeDTO) { + return baseMapper.getNationTypeData(outEmployeeDTO); + } + + @Override + public String getDictName(String key) { + return baseMapper.getDictName(key); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateEmployeeAndFamilyesAndJobRecords(OutEmployeeDTO employeeVO) { + OutEmployee employee = Func.copy(employeeVO, OutEmployee.class); + this.updateById(employee); + List families = Func.copy(employeeVO.getFamilyes(), OutEmployeeFamily.class); + outEmployeeFamilyService.updateBatchById(families); + List jobRecords = Func.copy(employeeVO.getJobRecords(), OutEmployeeJobRecord.class); + outEmployeeJobRecordService.updateBatchById(jobRecords); + return true; + } + + @Override + public OutEmployeeVO getEmployeeAndFamilyesAndJobRecords(String employeeId) { + OutEmployee detail = this.getById(employeeId); + List familyVOS = outEmployeeFamilyService.getByEmployeeId(employeeId); + List jobRecordVOS = outEmployeeJobRecordService.getByEmployeeId(employeeId); + //获取相关附件 + List attachments = fileService.getAttachments(employeeId,detail.getGroupName()); + //获取相关附件-证件照 + List attachmentsHead = fileService.getAttachments(employeeId,detail.getGroupNameHead()); + //获取相关附件-身份证正面 + List attachmentsFront = fileService.getAttachments(employeeId,detail.getGroupNameFront()); + //获取相关附件-身份证反面 + List attachmentsBack = fileService.getAttachments(employeeId,detail.getGroupNameBack()); + + OutEmployeeVO employeeVO = Func.copy(detail, OutEmployeeVO.class); + employeeVO.setFamilyes(familyVOS); + employeeVO.setJobRecords(jobRecordVOS); + employeeVO.setRelevantAttachments(attachments); + employeeVO.setPicList(attachmentsHead); + employeeVO.setIdCardFrontList(attachmentsFront); + employeeVO.setIdCardBackList(attachmentsBack); + return employeeVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveEmployeeAndFamilyesAndJobRecords(OutEmployeeDTO employeeVO) { + OutEmployee employee = Func.copy(employeeVO, OutEmployee.class); + employee.setDeptId(Long.parseLong(AuthUtil.getDeptId())); + this.saveOrUpdate(employee); +// 保存家庭成员明细 + List families = Func.copy(employeeVO.getFamilyes(), OutEmployeeFamily.class); + families.forEach(item -> item.setEmployeeId(employee.getId())); + outEmployeeFamilyService.saveOrUpdateBatch(families); +// 保存工作履历明细 + List jobRecords = Func.copy(employeeVO.getJobRecords(), OutEmployeeJobRecord.class); + jobRecords.forEach(item -> item.setEmployeeId(employee.getId())); + outEmployeeJobRecordService.saveOrUpdateBatch(jobRecords); + //保存相关附件信息 + fileService.saveAttachments(employeeVO.getRelevantAttachments(),employee.getId()); + //保存附件信息 + fileService.saveAttachments(employeeVO.getIdCardFrontList(),employee.getId()); + //保存附件信息 + fileService.saveAttachments(employeeVO.getIdCardBackList(),employee.getId()); + //保存附件信息 + fileService.saveAttachments(employeeVO.getPicList(),employee.getId()); + return true; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutCompanyVO.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutCompanyVO.java new file mode 100644 index 0000000..17d2813 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutCompanyVO.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.vo; + + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.outsourcing.entity.OutCompany; + +import java.util.List; + +/** + * 外包公司表视图实体类 + * + * @author BladeX + * @since 2022-02-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "OutCompanyVO对象", description = "外包公司表") +public class OutCompanyVO extends OutCompany { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + @TableField(exist = false) + private List fileList; + /** + * 资质及其他相关附件 + */ + private List qualificationsList; + /** + * 营业执照 + */ + private List licenseList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeFamilyVO.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeFamilyVO.java new file mode 100644 index 0000000..b3edd98 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeFamilyVO.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 外包员工家庭成员表视图实体类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Data +@ApiModel(value = "OutEmployeeFamilyVO对象", description = "外包员工家庭成员表") +public class OutEmployeeFamilyVO { + private static final long serialVersionUID = 1L; + + @JsonSerialize(using = ToStringSerializer.class) + private String id; + /** + * 外包员工ID + */ + @ApiModelProperty(value = "外包员工ID") + private String employeeId; + /** + * 姓名 + */ + @ApiModelProperty(value = "姓名") + private String name; + /** + * 与户主关系 + */ + @ApiModelProperty(value = "与户主关系") + private String relationship; + /** + * 出生日期 + */ + @ApiModelProperty(value = "出生日期") + @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd") + private Date brithDate; + /** + * 性别 + */ + @ApiModelProperty(value = "性别") + private String sex; + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + private String idCard; + /** + * 工作单位 + */ + @ApiModelProperty(value = "工作单位") + private String workUnit; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + private String telephone; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeJobRecordVO.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeJobRecordVO.java new file mode 100644 index 0000000..4793867 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeJobRecordVO.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * 外包员工工作履历表视图实体类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Data +@ApiModel(value = "OutEmployeeJobRecordVO对象", description = "外包员工工作履历表") +public class OutEmployeeJobRecordVO { + private static final long serialVersionUID = 1L; + + @JsonSerialize(using = ToStringSerializer.class) + private String id; + /** + * 外包员工ID + */ + @ApiModelProperty(value = "外包员工ID") + private String employeeId; + + /** + * 工作起始日期 + */ + @ApiModelProperty(value = "工作起始日期") + @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd") + private Date workStartDate; + /** + * 工作终止日期 + */ + @ApiModelProperty(value = "工作终止日期") + @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd") + private Date workEndDate; + /** + * 工作单位 + */ + @ApiModelProperty(value = "工作单位") + private String workUnit; + /** + * 岗位或主要从事工作 + */ + @ApiModelProperty(value = "岗位或主要从事工作") + private String jobContent; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeVO.java b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeVO.java new file mode 100644 index 0000000..3792694 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/outsourcing/vo/OutEmployeeVO.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.outsourcing.vo; + + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.outsourcing.entity.OutEmployee; + +import java.util.List; + +/** + * 外包员工信息表视图实体类 + * + * @author BladeX + * @since 2022-02-22 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "OutEmployeeVO对象", description = "外包员工信息表") +public class OutEmployeeVO extends OutEmployee { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + /** + * 外包公司名称 + */ + private String companyName; + @ApiModelProperty(value = "家庭成员") + private List familyes; + + @ApiModelProperty(value = "工作履历") + private List jobRecords; + /** + * 相关附件 + */ + private List relevantAttachments; + /** + * 证件照附件 + */ + private List picList; + /** + * 身份证正面照附件 + */ + private List idCardFrontList; + /** + * 身份证反面照附件 + */ + private List idCardBackList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/controller/PreventMaterialController.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/controller/PreventMaterialController.java new file mode 100644 index 0000000..eb32be2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/controller/PreventMaterialController.java @@ -0,0 +1,87 @@ +package org.security.trans.prevent.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.security.trans.prevent.dto.PreventMaterialDTO; +import org.security.trans.prevent.entity.PreventMaterial; +import org.security.trans.prevent.service.IPreventMaterialService; +import org.security.trans.prevent.vo.PreventMaterialVO; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * 案件材料报送表 控制器 + * + * @author BladeX + * @since 2022-07-07 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/preventmaterial") +@Api(value = "案件材料报送表", tags = "案件材料报送表接口") +public class PreventMaterialController extends BladeController { + + private final IPreventMaterialService preventMaterialService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入preventMaterial") + public R detail(PreventMaterial preventMaterial) { + PreventMaterialVO detail = preventMaterialService.getDetail(preventMaterial); + return R.data(detail); + } + + /** + * 分页 案件材料报送表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入preventMaterial") + public R> list(PreventMaterialVO preventMaterialVO, Query query) { + IPage page = preventMaterialService.getPage(preventMaterialVO, query); + return R.data(page); + } + + /** + * 暂存 案件材料报送表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "暂存", notes = "传入preventMaterial") + public R save(@Valid @RequestBody PreventMaterialDTO preventMaterialDTO) { + return preventMaterialService.saveMaterial(preventMaterialDTO); + } + + + /** + * 删除 案件材料报送表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(preventMaterialService.removeByIds(Func.toLongList(ids))); + } + + /** + * 提交 案件材料报送表 + */ + @PostMapping("/handin") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "提交", notes = "传入preventMaterial") + public R handin(@Valid @RequestBody PreventMaterialDTO preventMaterial) { + return R.status(preventMaterialService.handin(preventMaterial)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/controller/PreventRiskController.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/controller/PreventRiskController.java new file mode 100644 index 0000000..2c5be2e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/controller/PreventRiskController.java @@ -0,0 +1,87 @@ +package org.security.trans.prevent.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.security.trans.prevent.entity.PreventRisk; +import org.security.trans.prevent.service.IPreventRiskService; +import org.security.trans.prevent.vo.PreventRiskVO; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * 风险提示表 控制器 + * + * @author BladeX + * @since 2022-07-07 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/preventrisk") +@Api(value = "风险提示表", tags = "风险提示表接口") +public class PreventRiskController extends BladeController { + + private final IPreventRiskService preventRiskService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入preventRisk") + public R detail(PreventRisk preventRisk) { + PreventRiskVO detail = preventRiskService.getDetail(preventRisk); + return R.data(detail); + } + + /** + * 分页 风险提示表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入preventRisk") + public R> list(PreventRiskVO preventRiskVO, Query query) { + IPage page = preventRiskService.getPage(preventRiskVO, query); + return R.data(page); + } + + /** + * 暂存 风险提示表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "暂存", notes = "传入preventRisk") + public R save(@Valid @RequestBody PreventRiskVO preventRiskVO) { + return R.status(preventRiskService.saveRisk(preventRiskVO)); + } + + /** + * 提交 风险提示表 + */ + @PostMapping("/handin") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "提交", notes = "传入preventRisk") + public R update(@Valid @RequestBody PreventRiskVO preventRiskVO) { + return R.status(preventRiskService.handinRisk(preventRiskVO)); + } + + /** + * 删除 风险提示表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(preventRiskService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/dto/PreventMaterialDTO.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/dto/PreventMaterialDTO.java new file mode 100644 index 0000000..654b97f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/dto/PreventMaterialDTO.java @@ -0,0 +1,30 @@ +package org.security.trans.prevent.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.prevent.entity.PreventMaterial; + +import java.util.List; + +/** + * 案件材料报送表数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-07 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class PreventMaterialDTO extends PreventMaterial { + private static final long serialVersionUID = 1L; + private List fileList; + + /** + * 上报对象 + */ + @ApiModelProperty(value = "上报对象") + @TableField(exist = false) + private Integer commitRoleType; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/dto/PreventRiskDTO.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/dto/PreventRiskDTO.java new file mode 100644 index 0000000..771590d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/dto/PreventRiskDTO.java @@ -0,0 +1,21 @@ +package org.security.trans.prevent.dto; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.prevent.entity.PreventRisk; + +import java.util.List; + +/** + * 风险提示表数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-07 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class PreventRiskDTO extends PreventRisk { + private static final long serialVersionUID = 1L; + private List fileList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/entity/PreventMaterial.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/entity/PreventMaterial.java new file mode 100644 index 0000000..b86d21f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/entity/PreventMaterial.java @@ -0,0 +1,142 @@ +package org.security.trans.prevent.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.entity.common.FlowEntity; + +import java.io.Serializable; +import java.util.Date; + +/** + * 案件材料报送表实体类 + * + * @author BladeX + * @since 2022-07-07 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("T_PREVENT_MATERIAL") +@ApiModel(value = "PreventMaterial对象", description = "案件材料报送表") +public class PreventMaterial extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 类型;1-异常事件上报、2-处置情况上报、 3-重大事项报告 + */ + @ApiModelProperty(value = "类型;1-异常事件上报、2-处置情况上报、3-重大事项报告") + @TableField("TYPE") + private String type; + /** + * 任务ID + */ + @ApiModelProperty(value = "任务ID") + @TableField("TASK_ID") + private String taskId; + /** + * 任务名称 + */ + @ApiModelProperty(value = "任务名称") + @TableField("TASK_NAME") + private String taskName; + /** + * 事件描述 + */ + @ApiModelProperty(value = "事件描述") + @TableField("CASE_DESCRIBE") + private String caseDescribe; + /** + * 处置时间 + */ + @ApiModelProperty(value = "处置时间") + @TableField("DEAL_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date dealTime; + /** + * 处置结果 + */ + @ApiModelProperty(value = "处置结果") + @TableField("DEAL_RESULT") + private String dealResult; + /** + * 事件发生时间 + */ + @ApiModelProperty(value = "事件发生时间") + @TableField("OCCUR_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date occurTime; + + /** + * 删除标识 + */ + @ApiModelProperty(value = "删除标识 0-正常 1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + @ApiModelProperty(value = "机构ID") + @TableField("DEPT_ID") + private String deptId; + + @ApiModelProperty(value = "机构名称") + @TableField("DEPT_NAME") + private String deptName; + /** + * 提报期限 + */ + @ApiModelProperty(value = "提报期限") + @TableField("DEADLINE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date deadline; + /** + * 提报用户 + */ + @ApiModelProperty(value = "提报用户") + @TableField("USER_ID") + private String userId; + /** + * 提报角色 + */ + @ApiModelProperty(value = "提报角色") + @TableField("ROLE_ID") + private String roleId; + /** + * 审批状态(0-待提交,1-审批中,2-审批通过 + */ + @ApiModelProperty(value = "审批状态(0-待提交,1-审批中,2-审批通过)") + @TableField("STATE") + private String state; + /** + * 业务状态(0-待提交,1-超时未提报,2-已提报,3-超时已提报) + */ + @ApiModelProperty(value = "业务状态(0-待提交,1-超时未提报,2-已提报,3-超时已提报)") + @TableField("STATUS") + private String status; + + /** + * 是否跨分行提交到总行 + */ + @ApiModelProperty(value = "是否跨分行提交到总行") + @TableField("CROSS_BRANCH") + private Boolean crossBranch; + /** + * 附件groupname + */ + @ApiModelProperty(value = "附件groupname") + @TableField("GROUP_NAME") + private String groupName; + /** + * 提报时间 + */ + @ApiModelProperty(value = "提报时间") + @TableField("SUBMIT_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date submitTime; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/entity/PreventRisk.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/entity/PreventRisk.java new file mode 100644 index 0000000..a533b04 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/entity/PreventRisk.java @@ -0,0 +1,84 @@ +package org.security.trans.prevent.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.entity.common.FlowEntity; + +import java.io.Serializable; +import java.util.Date; + +/** + * 风险提示表实体类 + * + * @author BladeX + * @since 2022-07-07 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("T_PREVENT_RISK") +@ApiModel(value = "PreventRisk对象", description = "风险提示表") +public class PreventRisk extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 机构ID + */ + @ApiModelProperty(value = "机构ID") + @TableField("DEPT_ID") + private String deptId; + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @TableField("DEPT_NAME") + private String deptName; + /** + * 删除标识 + */ + @ApiModelProperty(value = "删除标识 0-正常 1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 风险名称 + */ + @ApiModelProperty(value = "风险名称") + @TableField("RISK_NAME") + private String riskName; + /** + * 风险描述 + */ + @ApiModelProperty(value = "风险描述") + @TableField("RISK_DESCRIBE") + private String riskDescribe; + /** + * 状态 0-待提报 1-提报待审批 2-审批完成 3-驳回 + */ + @ApiModelProperty(value = "状态") + @TableField("STATE") + private String state; + /** + * 附件groupname + */ + @ApiModelProperty(value = "附件groupname") + @TableField("GROUP_NAME") + private String groupName; + /** + * 上报时间 + */ + @ApiModelProperty(value = "上报时间") + @TableField("SUBMIT_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date submitTime; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventMaterialMapper.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventMaterialMapper.java new file mode 100644 index 0000000..7fc7ffb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventMaterialMapper.java @@ -0,0 +1,27 @@ +package org.security.trans.prevent.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.security.trans.dataStatistics.dto.MaterialDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.MaterialDataVO; +import org.security.trans.prevent.entity.PreventMaterial; +import org.security.trans.prevent.vo.PreventMaterialVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 案件材料报送表 Mapper 接口 + * + * @author BladeX + * @since 2022-07-07 + */ +public interface PreventMaterialMapper extends BaseMapper { + + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List getPage(IPage page, @Param("preventMaterialVO")PreventMaterialVO preventMaterialVO); + + List getAimStatisticsData(@Param("materialDataDTO") MaterialDataDTO materialDataDTO, @Param("aimDepts") List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventMaterialMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventMaterialMapper.xml new file mode 100644 index 0000000..ba232e2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventMaterialMapper.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventRiskMapper.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventRiskMapper.java new file mode 100644 index 0000000..f928c0f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventRiskMapper.java @@ -0,0 +1,24 @@ +package org.security.trans.prevent.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.RiskDataVO; +import org.security.trans.prevent.entity.PreventRisk; +import org.security.trans.prevent.vo.PreventRiskVO; + +import java.util.List; + +/** + * 风险提示表 Mapper 接口 + * + * @author BladeX + * @since 2022-07-07 + */ +public interface PreventRiskMapper extends BaseMapper { + + List getPage(IPage page, @Param("preventRiskVO")PreventRiskVO preventRiskVO); + + List getAimStatisticsData(@Param("statisticsDataDTO") StatisticsDataDTO statisticsDataDTO,@Param("aimDepts") List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventRiskMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventRiskMapper.xml new file mode 100644 index 0000000..8a9435e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/mapper/PreventRiskMapper.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/service/IPreventMaterialService.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/service/IPreventMaterialService.java new file mode 100644 index 0000000..5dc54f3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/service/IPreventMaterialService.java @@ -0,0 +1,58 @@ +package org.security.trans.prevent.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.trans.common.service.FlowableService; +import org.security.trans.dataStatistics.dto.MaterialDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.MaterialDataVO; +import org.security.trans.prevent.dto.PreventMaterialDTO; +import org.security.trans.prevent.entity.PreventMaterial; +import org.security.trans.prevent.vo.PreventMaterialVO; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; + +import java.util.Date; +import java.util.List; + +/** + * 案件材料报送表 服务类 + * + * @author BladeX + * @since 2022-07-07 + */ +public interface IPreventMaterialService extends FlowableService { + + IPage getPage(PreventMaterialVO preventMaterialVO, Query query); + + PreventMaterialVO getDetail(PreventMaterial preventMaterial); + + R saveMaterial(PreventMaterialDTO preventMaterialDTO); + + /** + * 提交审批 + * @param preventMaterialDTO + * @return + */ + boolean handin(PreventMaterialDTO preventMaterialDTO); + + /** + * 查询对应状态的记录 + * @param status + * @return + */ + List getPreventList(String status); + + /** + *定时任务获取案件防控任务信息 + */ + PreventMaterial getPreventMaterialDatas(String id, String deptId, Date begin, Date end); + + /** + * 案件材料报送统计 + * @param materialDataDTO + * @param aimDepts + * @return + */ + List getAimStatisticsData(MaterialDataDTO materialDataDTO, List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/service/IPreventRiskService.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/service/IPreventRiskService.java new file mode 100644 index 0000000..0383dbb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/service/IPreventRiskService.java @@ -0,0 +1,34 @@ +package org.security.trans.prevent.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.trans.common.service.FlowableService; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.RiskDataVO; +import org.security.trans.prevent.entity.PreventRisk; +import org.security.trans.prevent.vo.PreventRiskVO; +import org.springblade.core.mp.support.Query; + +import java.util.List; + +/** + * 风险提示表 服务类 + * + * @author BladeX + * @since 2022-07-07 + */ +public interface IPreventRiskService extends FlowableService { + + IPage getPage(PreventRiskVO preventRiskVO, Query query); + + boolean saveRisk(PreventRiskVO preventRiskVO); + + boolean handinRisk(PreventRiskVO preventRiskVO); + + PreventRiskVO getDetail(PreventRisk preventRisk); + + /** + *风险提示数据统计 + */ + List getAimStatisticsData(StatisticsDataDTO statisticsDataDTO, List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/service/impl/PreventMaterialServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/service/impl/PreventMaterialServiceImpl.java new file mode 100644 index 0000000..5feaeaa --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/service/impl/PreventMaterialServiceImpl.java @@ -0,0 +1,165 @@ +package org.security.trans.prevent.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.entity.Dept; +import org.security.system.feign.ISysClient; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dataStatistics.dto.MaterialDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.MaterialDataVO; +import org.security.trans.prevent.dto.PreventMaterialDTO; +import org.security.trans.prevent.entity.PreventMaterial; +import org.security.trans.prevent.mapper.PreventMaterialMapper; +import org.security.trans.prevent.service.IPreventMaterialService; +import org.security.trans.prevent.vo.PreventMaterialVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.Objects; + +import static org.security.common.Constant.TASK_HANDIN_STATE_OVERTIME_SUBMIT; +import static org.security.common.Constant.TASK_HANDIN_STATE_SUBMIT; + +/** + * 案件材料报送表 服务实现类 + * + * @author BladeX + * @since 2022-07-07 + */ +@AllArgsConstructor +@Service +public class PreventMaterialServiceImpl extends ServiceImpl implements IPreventMaterialService { + + private final IFileService fileService; + private final PreventMaterialMapper preventMaterialMapper; + private final IFlowClient flowClient; + private final ISysClient sysClient; + private final IDepartmentService departmentService; + + @Override + public IPage getPage(PreventMaterialVO preventMaterialVO, Query query) { + String user = String.valueOf(AuthUtil.getUserId()); + IPage page = Condition.getPage(query); + List preventMaterialVos = preventMaterialMapper.getPage(page, preventMaterialVO); + preventMaterialVos.forEach(item->{ + //创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + //更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + return page.setRecords(preventMaterialVos); + } + + @Override + public PreventMaterialVO getDetail(PreventMaterial preventMaterial) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(preventMaterial); + PreventMaterial material = this.getOne(queryWrapper); + List attachments = fileService.getAttachments(material.getId(),material.getGroupName()); + PreventMaterialVO preventMaterialVO = BeanUtil.copyProperties(material, PreventMaterialVO.class); + preventMaterialVO.setFileList(attachments); + return preventMaterialVO; + } + + @Override + public R saveMaterial(PreventMaterialDTO preventMaterialDTO) { + PreventMaterial preventMaterial = BeanUtil.copyProperties(preventMaterialDTO, PreventMaterial.class); + if(Func.isNull(preventMaterial.getDeptId()) || Func.isBlank(preventMaterial.getDeptId())){ + preventMaterial.setDeptId(AuthUtil.getDeptId()); + } + preventMaterial.setDeptName(departmentService.getById(preventMaterial.getDeptId()).getDeptName()); + this.saveOrUpdate(preventMaterial); + List fileList = preventMaterialDTO.getFileList(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, preventMaterial.getId()); + } + return R.data(preventMaterial); + } + + @Override + public boolean handin(PreventMaterialDTO preventMaterialDTO) { + if(Func.isNull(preventMaterialDTO.getDeptId()) || Func.isBlank(preventMaterialDTO.getDeptId())){ + preventMaterialDTO.setDeptId(AuthUtil.getDeptId()); + } + preventMaterialDTO.setDeptName(departmentService.getById(preventMaterialDTO.getDeptId()).getDeptName()); + R material = saveMaterial(preventMaterialDTO); + PreventMaterial preventMaterial = (PreventMaterial) material.getData(); + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.PREVENT_MATERIAL_KEY); + if (definitionRes.isSuccess()) { + preventMaterial.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + String businessTable = FlowUtil.getBusinessTable(PreventMaterial.class); + R deptRes = sysClient.getDept(Long.valueOf(preventMaterial.getDeptId())); + if (!deptRes.isSuccess()) { + throw new ServiceException("开启流程失败,未能查询到部门信息"); + } + Kv variables = Kv.create() + .set("category", preventMaterialDTO.getCommitRoleType()) + .set(ProcessConstant.BUSINESS_ID_KEY, preventMaterial.getId()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + R result = flowClient.startProcessInstanceById(preventMaterial.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(preventMaterial.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + // 返回流程id写入preventMaterial + preventMaterial.setProcessInstanceId(result.getData().getProcessInstanceId()); + preventMaterial.setState(Constant.HANDIN_STATE_AUDIT); + preventMaterial.setSubmitTime(DateUtil.now()); + Date deadline = preventMaterial.getDeadline(); + if(!Func.isNull(deadline) && Func.isNotEmpty(deadline)){ + preventMaterial.setStatus(deadline.after(new Date())?TASK_HANDIN_STATE_SUBMIT:TASK_HANDIN_STATE_OVERTIME_SUBMIT);//业务状态 + }else{ + preventMaterial.setStatus(TASK_HANDIN_STATE_SUBMIT); + } + this.saveOrUpdate(preventMaterial); + return true; + } else { + throw new ServiceException("开启流程失败"); + } + } + + @Override + public List getPreventList(String status) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("STATUS", status); + wrapper.eq("DEL_FLAG","0"); + return baseMapper.selectList(wrapper); + } + + @Override + public PreventMaterial getPreventMaterialDatas(String id, String deptId, Date begin, Date end) { + return this.getOne(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(id),PreventMaterial::getTaskId,id) + .eq(Func.isNotEmpty(deptId),PreventMaterial::getDeptId,deptId) + .ge(Func.isNotEmpty(begin),PreventMaterial::getCreatedTime,begin) + .le(Func.isNotEmpty(end),PreventMaterial::getCreatedTime,end)); + } + + @Override + public List getAimStatisticsData(MaterialDataDTO materialDataDTO, List aimDepts) { + return baseMapper.getAimStatisticsData(materialDataDTO,aimDepts); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/service/impl/PreventRiskServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/service/impl/PreventRiskServiceImpl.java new file mode 100644 index 0000000..edb464d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/service/impl/PreventRiskServiceImpl.java @@ -0,0 +1,155 @@ +package org.security.trans.prevent.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.feign.ISysClient; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.RiskDataVO; +import org.security.trans.prevent.entity.PreventRisk; +import org.security.trans.prevent.mapper.PreventRiskMapper; +import org.security.trans.prevent.service.IPreventRiskService; +import org.security.trans.prevent.vo.PreventRiskVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.TreeSet; +import java.util.stream.Collectors; + +/** + * 风险提示表 服务实现类 + * + * @author BladeX + * @since 2022-07-07 + */ +@AllArgsConstructor +@Service +public class PreventRiskServiceImpl extends ServiceImpl implements IPreventRiskService { + + private final IFileService fileService; + private final PreventRiskMapper preventRiskMapper; + private final IFlowClient flowClient; + private final ISysClient sysClient; + private final IDepartmentService departmentService; + + @Override + public IPage getPage(PreventRiskVO preventRiskVO, Query query) { + List vos = new ArrayList<>(); + String user = String.valueOf(AuthUtil.getUserId()); + IPage page = Condition.getPage(query); + List preventRiskVOS = preventRiskMapper.getPage(page, preventRiskVO); + preventRiskVOS.forEach(item -> { + //当前登录用户创建的数据 + if (user.equals(item.getCreatedBy())){ + //创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + //更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + vos.add(item); + } + }); + //其他用户提报且状态为-审批完成的数据 + List collect = preventRiskVOS.stream().filter(item -> Constant.HANDIN_STATE_FINISH.equals(item.getState())).collect(Collectors.toList()); + vos.addAll(collect); + ArrayList list = vos.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(PreventRiskVO::getId))), ArrayList::new)); + return page.setRecords(list); + } + + @Override + public PreventRiskVO getDetail(PreventRisk preventRisk) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(preventRisk); + PreventRisk risk = this.getOne(queryWrapper); + PreventRiskVO preventRiskVO = BeanUtil.copyProperties(risk, PreventRiskVO.class); + preventRiskVO.setFileList(fileService.getAttachments(risk.getId(), risk.getGroupName())); + return preventRiskVO; + } + + @Override + public List getAimStatisticsData(StatisticsDataDTO statisticsDataDTO, List aimDepts) { + return baseMapper.getAimStatisticsData(statisticsDataDTO,aimDepts); + } + + @Override + public boolean saveRisk(PreventRiskVO preventRiskVO) { + PreventRisk preventRisk = BeanUtil.copyProperties(preventRiskVO, PreventRisk.class); + if(Func.isNull(preventRisk.getDeptId()) || Func.isBlank(preventRisk.getDeptId())){ + preventRisk.setDeptId(AuthUtil.getDeptId()); + } + preventRisk.setDeptName(departmentService.getById(AuthUtil.getDeptId()).getDeptName()); + this.saveOrUpdate(preventRisk); + List fileList = preventRiskVO.getFileList(); + if (Func.isNotEmpty(fileList)) { + fileService.saveAttachments(fileList, preventRisk.getId()); + } + return this.saveOrUpdate(preventRisk); + } + + @Override + public boolean handinRisk(PreventRiskVO preventRiskVO) { + PreventRisk preventRisk = BeanUtil.copyProperties(preventRiskVO, PreventRisk.class); + if(Func.isNull(preventRisk.getDeptId()) || Func.isBlank(preventRisk.getDeptId())){ + preventRisk.setDeptId(AuthUtil.getDeptId()); + } + preventRisk.setDeptName(departmentService.getById(AuthUtil.getDeptId()).getDeptName()); + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.PREVENT_RISK_KEY); + if (definitionRes.isSuccess()) { + preventRisk.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + if(Func.isNull(preventRisk.getDeptId()) || Func.isBlank(preventRisk.getDeptId())){ + preventRisk.setDeptId(AuthUtil.getDeptId()); + } + this.saveOrUpdate(preventRisk); + + String businessTable = FlowUtil.getBusinessTable(PreventRisk.class); + +// 保存相关附件 + List fileList = preventRiskVO.getFileList(); + if (Func.isNotEmpty(fileList)) { + fileService.saveAttachments(fileList, preventRisk.getId()); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + // 启动流程 + Kv variables = Kv.create() + .set(ProcessConstant.BUSINESS_ID_KEY, preventRisk.getId()) + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + R result = flowClient.startProcessInstanceById(preventRisk.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(preventRisk.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + // 返回流程id写入preventRisk + preventRisk.setProcessInstanceId(result.getData().getProcessInstanceId()); + preventRisk.setSubmitTime(DateUtil.now()); + preventRisk.setState(Constant.HANDIN_STATE_AUDIT); + updateById(preventRisk); + } else { + throw new ServiceException("开启流程失败"); + } + return true; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/vo/PreventMaterialVO.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/vo/PreventMaterialVO.java new file mode 100644 index 0000000..5e704e7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/vo/PreventMaterialVO.java @@ -0,0 +1,60 @@ +package org.security.trans.prevent.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.prevent.entity.PreventMaterial; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; + +import java.util.Date; +import java.util.List; + +/** + * 案件材料报送表视图实体类 + * + * @author BladeX + * @since 2022-07-07 + */ +@Data +@ApiModel(value = "PreventMaterialVO对象", description = "案件材料报送表") +public class PreventMaterialVO extends PreventMaterial { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "任务名称") + private String taskName; + + + @ApiModelProperty(value = "机构名称") + private String deptName; + + private List fileList; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + + private boolean editable; + + private boolean deletable; + + public boolean isEditable() { + if ((Constant.HANDIN_STATE_DRAFT.equals(this.getState()) || Constant.HANDIN_STATE_REFUSE.equals(this.getState()) || ProcessConstant.CANCEL_STATE.equals(this.getState())) && + ((Func.isNotBlank(this.getCreatedBy()) && this.getCreatedBy().contains(String.valueOf(AuthUtil.getUserId()))) || this.getUserId().contains(String.valueOf(AuthUtil.getUserId())) || AuthUtil.getUser().getRoleId().contains(this.getRoleId())) ) { + return true; + } + return false; + } + + public boolean isDeletable() { + if (Constant.HANDIN_STATE_DRAFT.equals(this.getState()) && Func.isEmpty(this.getDeadline()) ) { + return true; + } + return false; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/prevent/vo/PreventRiskVO.java b/security-service/ht-security/src/main/java/org/security/trans/prevent/vo/PreventRiskVO.java new file mode 100644 index 0000000..0a887d3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/prevent/vo/PreventRiskVO.java @@ -0,0 +1,46 @@ +package org.security.trans.prevent.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.prevent.entity.PreventRisk; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.DateUtil; + +import java.util.Date; +import java.util.List; + +/** + * 风险提示表视图实体类 + * + * @author BladeX + * @since 2022-07-07 + */ +@Data +@ApiModel(value = "PreventRiskVO对象", description = "风险提示表") +public class PreventRiskVO extends PreventRisk { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "机构名称") + private String deptName; + + private List fileList; + + private boolean editable; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + + + public boolean isEditable() { + if ((Constant.HANDIN_STATE_DRAFT.equals(this.getState()) || Constant.HANDIN_STATE_REFUSE.equals(this.getState()) || ProcessConstant.CANCEL_STATE.equals(this.getState())) && String.valueOf(AuthUtil.getUserId()).equals(this.getCreatedBy()) ) { + return true; + } + return false; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/BudgetItemController.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/BudgetItemController.java new file mode 100644 index 0000000..b64dfec --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/BudgetItemController.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.projectBudgetManagement.dto.BudgetItemDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.entity.BudgetItem; +import org.security.trans.projectBudgetManagement.vo.BudgetItemVO; +import org.security.trans.projectBudgetManagement.service.IBudgetItemService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.util.List; + +/** + * 项目管理-预算管理信息表 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/budgetitem") +@Api(value = "项目管理-预算管理信息表", tags = "项目管理-预算管理信息表接口") +public class BudgetItemController extends BladeController { + + private final IBudgetItemService budgetItemService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入budgetItem") + public R detail(@PathVariable String id) { + return R.data(budgetItemService.getData(id)); + } + + /** + * 获取父级预算信息 + */ + @GetMapping("/parent-budget") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "获取父级预算信息", notes = "传入deptId") + public R> getParentBudget(String deptId) { + return R.data(budgetItemService.getParentBudget(deptId)); + } + + /** + * 自定义分页 项目管理-预算管理信息表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入budgetItemDTO") + public R> page(BudgetItemDTO budgetItemDTO, Query query) { + IPage pages = budgetItemService.selectBudgetItemPage(Condition.getPage(query), budgetItemDTO); + return R.data(pages); + } + + /** + * 新增/更新 项目管理-预算管理信息表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增/更新", notes = "传入budgetItem") + public R save(@Valid @RequestBody BudgetItemDTO budgetItemDTO) { + return R.status(budgetItemService.saveData(budgetItemDTO)); + } + + /** + * 删除 项目管理-预算管理信息表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(budgetItemService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectCheckController.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectCheckController.java new file mode 100644 index 0000000..e1bad8c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectCheckController.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.entity.ProjectCheck; +import org.security.trans.projectBudgetManagement.vo.ProjectCheckVO; +import org.security.trans.projectBudgetManagement.service.IProjectCheckService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 项目管理-项目验收材料 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/projectcheck") +@Api(value = "项目管理-项目验收材料", tags = "项目管理-项目验收材料接口") +public class ProjectCheckController extends BladeController { + + private final IProjectCheckService projectCheckService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入projectCheck") + public R detail(@PathVariable String id) { + return R.data(projectCheckService.getData(id)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectContractController.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectContractController.java new file mode 100644 index 0000000..dc53112 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectContractController.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import org.security.trans.projectBudgetManagement.dto.ProjectContractDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.vo.ProjectContractVO; +import org.security.trans.projectBudgetManagement.service.IProjectContractService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.util.List; + +/** + * 项目管理-项目合同 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/projectcontract") +@Api(value = "项目管理-项目合同", tags = "项目管理-项目合同接口") +public class ProjectContractController extends BladeController { + + private final IProjectContractService projectContractService; + + /** + * 根据项目id查询对应合同 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R> detail(@PathVariable String id) { + return R.data(projectContractService.getDaya(id)); + } + /** + * 自定义分页 项目管理-项目管理信息主表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入project") + public R> page(ProjectContractDTO projectContractDTO, Query query) { + IPage pages = projectContractService.selectProjectContractPage(Condition.getPage(query), projectContractDTO); + return R.data(pages); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectController.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectController.java new file mode 100644 index 0000000..1509298 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectController.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.validation.Valid; + +import org.security.trans.projectBudgetManagement.dto.ProjectDTO; +import org.security.trans.projectBudgetManagement.dto.ProjectOverReviewDTO; +import org.security.trans.projectBudgetManagement.dto.ProjectPayPlanDTO; +import org.security.trans.projectBudgetManagement.vo.ProjectContractVO; +import org.security.trans.projectBudgetManagement.vo.ProjectPayPlanVO; +import org.security.trans.projectBudgetManagement.vo.RemindDataVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.vo.ProjectVO; +import org.security.trans.projectBudgetManagement.service.IProjectService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.text.ParseException; +import java.util.List; + +/** + * 项目管理-项目管理信息主表 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/project") +@Api(value = "项目管理-项目管理信息主表", tags = "项目管理-项目管理信息主表接口") +public class ProjectController extends BladeController { + + private final IProjectService projectService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(projectService.getData(id)); + } + + /** + * 获取父级项目信息 + */ + @GetMapping("/parent") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "获取父级项目信息") + public R> getParentProject() { + return R.data(projectService.getParentProject()); + } + + /** + * 自定义分页 项目管理-项目管理信息主表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入project") + public R> page(ProjectDTO projectDTO, Query query) { + IPage pages = projectService.selectProjectPage(Condition.getPage(query), projectDTO); + return R.data(pages); + } + + /** + * 新增/修改 项目管理-项目管理信息主表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增/修改", notes = "传入project") + public R save(@Valid @RequestBody ProjectDTO projectDTO) { + return R.status(projectService.saveData(projectDTO)); + } + + /** + * 删除 项目管理-项目管理信息主表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(projectService.removeData(Func.toLongList(ids))); + } + + /** + * 项目管理-项目结项 + */ + @PostMapping("/over") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "项目结项", notes = "传入id") + public R projectOver(@ApiParam(value = "主键集合", required = true) @RequestParam String id) { + return R.status(projectService.projectOver(id)); + } + + + /** + * 结项项目审阅 + */ + @PostMapping("/review") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "结项项目审阅", notes = "传入id") + public R projectOverReview(@RequestBody ProjectOverReviewDTO projectOverReviewDTO) { + return R.status(projectService.projectOverReview(projectOverReviewDTO)); + } + + + /** + * 首页-设备维保到期、项目付款计划时间到期、项目合同到期提醒 + */ + @GetMapping("/remind/data") + @ApiOperationSupport(order = 11) + @ApiOperation(value = "首页到期提醒", notes = "") + public R> getRemindData() throws ParseException { + return R.data(projectService.getRemindData()); + } + + /** + * 项目付款计划详情 + */ + @GetMapping("/pay-plan/{id}") + @ApiOperationSupport(order = 12) + @ApiOperation(value = "项目付款计划详情", notes = "") + public R getProjectPayPlanData(@PathVariable String id) { + return R.data(projectService.getProjectPayPlanData(id)); + } + + /** + * 合同详情 + */ + @GetMapping("/contract/{id}") + @ApiOperationSupport(order = 13) + @ApiOperation(value = "项目合同详情", notes = "") + public R getProjectContractData(@PathVariable String id) { + return R.data(projectService.getProjectContractData(id)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectEstablishmentController.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectEstablishmentController.java new file mode 100644 index 0000000..0ebf230 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectEstablishmentController.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.entity.ProjectEstablishment; +import org.security.trans.projectBudgetManagement.vo.ProjectEstablishmentVO; +import org.security.trans.projectBudgetManagement.service.IProjectEstablishmentService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 项目管理-项目立项资料 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/projectestablishment") +@Api(value = "项目管理-项目立项资料", tags = "项目管理-项目立项资料接口") +public class ProjectEstablishmentController extends BladeController { + + private final IProjectEstablishmentService projectEstablishmentService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(projectEstablishmentService.getData(id)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectImplementationController.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectImplementationController.java new file mode 100644 index 0000000..c02fd13 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectImplementationController.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.entity.ProjectImplementation; +import org.security.trans.projectBudgetManagement.vo.ProjectImplementationVO; +import org.security.trans.projectBudgetManagement.service.IProjectImplementationService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 项目管理-项目实施材料 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/projectimplementation") +@Api(value = "项目管理-项目实施材料", tags = "项目管理-项目实施材料接口") +public class ProjectImplementationController extends BladeController { + + private final IProjectImplementationService projectImplementationService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(projectImplementationService.getData(id)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectOverHistoryController.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectOverHistoryController.java new file mode 100644 index 0000000..5acee79 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectOverHistoryController.java @@ -0,0 +1,18 @@ +package org.security.trans.projectBudgetManagement.controller; + +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author :wzf + * @apiNote :项目结项流水记录 + * @since :Created in 2022/9/19 19:56 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/project_over") +@Api(value = "项目管理-项目结项流水记录", tags = "项目管理-项目结项流水记录") +public class ProjectOverHistoryController { +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectPayPlanController.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectPayPlanController.java new file mode 100644 index 0000000..645716c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectPayPlanController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.entity.ProjectPayPlan; +import org.security.trans.projectBudgetManagement.vo.ProjectPayPlanVO; +import org.security.trans.projectBudgetManagement.service.IProjectPayPlanService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 项目管理-付款计划及跟踪 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/projectpayplan") +@Api(value = "项目管理-付款计划及跟踪", tags = "项目管理-付款计划及跟踪接口") +public class ProjectPayPlanController extends BladeController { + + private final IProjectPayPlanService projectPayPlanService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入projectPayPlan") + public R detail(ProjectPayPlan projectPayPlan) { + ProjectPayPlan detail = projectPayPlanService.getOne(Condition.getQueryWrapper(projectPayPlan)); + return R.data(detail); + } + + /** + * 分页 项目管理-付款计划及跟踪 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入projectPayPlan") + public R> list(ProjectPayPlan projectPayPlan, Query query) { + IPage pages = projectPayPlanService.page(Condition.getPage(query), Condition.getQueryWrapper(projectPayPlan)); + return R.data(pages); + } + + /** + * 自定义分页 项目管理-付款计划及跟踪 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入projectPayPlan") + public R> page(ProjectPayPlanVO projectPayPlan, Query query) { + IPage pages = projectPayPlanService.selectProjectPayPlanPage(Condition.getPage(query), projectPayPlan); + return R.data(pages); + } + + /** + * 新增 项目管理-付款计划及跟踪 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入projectPayPlan") + public R save(@Valid @RequestBody ProjectPayPlan projectPayPlan) { + return R.status(projectPayPlanService.save(projectPayPlan)); + } + + /** + * 修改 项目管理-付款计划及跟踪 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入projectPayPlan") + public R update(@Valid @RequestBody ProjectPayPlan projectPayPlan) { + return R.status(projectPayPlanService.updateById(projectPayPlan)); + } + + /** + * 新增或修改 项目管理-付款计划及跟踪 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入projectPayPlan") + public R submit(@Valid @RequestBody ProjectPayPlan projectPayPlan) { + return R.status(projectPayPlanService.saveOrUpdate(projectPayPlan)); + } + + + /** + * 删除 项目管理-付款计划及跟踪 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(projectPayPlanService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectPurchaseController.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectPurchaseController.java new file mode 100644 index 0000000..fd8b232 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/controller/ProjectPurchaseController.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.entity.ProjectPurchase; +import org.security.trans.projectBudgetManagement.vo.ProjectPurchaseVO; +import org.security.trans.projectBudgetManagement.service.IProjectPurchaseService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 项目管理-项目采购材料 控制器 + * + * @author BladeX + * @since 2022-08-05 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/projectpurchase") +@Api(value = "项目管理-项目采购材料", tags = "项目管理-项目采购材料接口") +public class ProjectPurchaseController extends BladeController { + + private final IProjectPurchaseService projectPurchaseService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(projectPurchaseService.getData(id)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/BudgetItemDTO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/BudgetItemDTO.java new file mode 100644 index 0000000..a33b756 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/BudgetItemDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.dto; + +import org.security.trans.projectBudgetManagement.entity.BudgetItem; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 项目管理-预算管理信息表数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BudgetItemDTO extends BudgetItem { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectCheckDTO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectCheckDTO.java new file mode 100644 index 0000000..36a1698 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectCheckDTO.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectCheck; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 项目管理-项目验收材料数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class ProjectCheckDTO extends ProjectCheck { + private static final long serialVersionUID = 1L; + + /** + * 验收材料相关附件 + */ + private List checkAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectContractDTO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectContractDTO.java new file mode 100644 index 0000000..db33183 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectContractDTO.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectContract; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 项目管理-项目合同数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class ProjectContractDTO extends ProjectContract { + private static final long serialVersionUID = 1L; + + /** + * 合同原件 + */ + private List contractAttachments; + + /** + * 补充材料 + */ + private List supplementAttachments; + + /** + * 法审后意见 + */ + private List legalAttachments; + + /** + * 项目合同其他材料 + */ + private List otherAttachments; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectDTO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectDTO.java new file mode 100644 index 0000000..e749d9b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectDTO.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.dto; + +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import org.security.trans.projectBudgetManagement.entity.Project; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.projectBudgetManagement.vo.*; + +import java.util.List; + +/** + * 项目管理-项目管理信息主表数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AllArgsConstructor +@NoArgsConstructor +public class ProjectDTO extends Project { + private static final long serialVersionUID = 1L; + + /** + * 付款计划 + */ + private List payPlanList; + + /** + * 项目立项信息 + */ + private ProjectEstablishmentDTO projectEstablishment; + + /** + * 项目采购信息 + */ + private ProjectPurchaseDTO projectPurchase; + + /** + * 项目合同信息 + */ + private List projectContract; + + /** + * 项目实施信息 + */ + private ProjectImplementationDTO projectImplementation; + + /** + * 项目验收信息 + */ + private ProjectCheckDTO projectCheck; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectEstablishmentDTO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectEstablishmentDTO.java new file mode 100644 index 0000000..2b623a7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectEstablishmentDTO.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectEstablishment; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 项目管理-项目立项资料数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class ProjectEstablishmentDTO extends ProjectEstablishment { + private static final long serialVersionUID = 1L; + + /** + * 项目立项图纸 + */ + private List drawAttachments; + + /** + * 项目造价材料 + */ + private List costAttachments; + + /** + * 项目立项材料 + */ + private List materialAttachments; + + /** + * 项目立项会审材料 + */ + private List financialAttachments; + + /** + * 项目立项其他材料 + */ + private List otherAttachments; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectImplementationDTO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectImplementationDTO.java new file mode 100644 index 0000000..4484c0c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectImplementationDTO.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectImplementation; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 项目管理-项目实施材料数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class ProjectImplementationDTO extends ProjectImplementation { + private static final long serialVersionUID = 1L; + + /** + * 项目实施文件材料 + */ + private List implementationAttachments; + + /** + * 工程变更单 + */ + private List engineeringAttachments; + + /** + * 设备合格资料 + */ + private List deviceAttachments; + + /** + * 项目实施其他材料 + */ + private List otherAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectOverReviewDTO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectOverReviewDTO.java new file mode 100644 index 0000000..dc95739 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectOverReviewDTO.java @@ -0,0 +1,26 @@ +package org.security.trans.projectBudgetManagement.dto; + +import lombok.Data; + +/** + * @author :wzf + * @apiNote :结项项目审阅操作实体 + * @since :Created in 2022/9/20 10:09 + */ +@Data +public class ProjectOverReviewDTO { + /** + * 项目id + */ + private String id; + + /** + * 结项项目审阅操作状态 2-结项驳回,3-同意结项 + */ + private Integer reviewStatus; + + /** + * 审阅意见 + */ + private String remark; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectPayPlanDTO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectPayPlanDTO.java new file mode 100644 index 0000000..0925103 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectPayPlanDTO.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.dto; + +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectPayPlan; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 项目管理-付款计划及跟踪数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AllArgsConstructor +@NoArgsConstructor +public class ProjectPayPlanDTO extends ProjectPayPlan { + private static final long serialVersionUID = 1L; + + /** + * 发票相关附件 + */ + private List invoiceAttachments; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectPurchaseDTO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectPurchaseDTO.java new file mode 100644 index 0000000..f165bd1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/dto/ProjectPurchaseDTO.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectPurchase; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 项目管理-项目采购材料数据传输对象实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class ProjectPurchaseDTO extends ProjectPurchase { + private static final long serialVersionUID = 1L; + + /** + * 公开招标材料 + */ + private List publicBiddingAttachments; + + /** + * 邀请招标材料 + */ + private List inviteBiddingAttachments; + + /** + * 询价采购材料 + */ + private List inquiryAttachments; + + /** + * 单一来源采购材料 + */ + private List singleSourceAttachments; + + /** + * 竞争性谈判材料 + */ + private List competitiveAttachments; + + /** + * 项目采购其他材料 + */ + private List otherAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/BudgetItem.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/BudgetItem.java new file mode 100644 index 0000000..3a98607 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/BudgetItem.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 项目管理-预算管理信息表实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_BUDGET_ITEM") +@ApiModel(value = "BudgetItem对象", description = "项目管理-预算管理信息表") +public class BudgetItem extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + @TableId("ID") + private String id; + /** + * 父级预算id + */ + @ApiModelProperty(value = "父级预算id") + @TableField("PARENT_BUDGET_ID") + private String parentBudgetId; + /** + * 预算编号 + */ + @ApiModelProperty(value = "预算编号") + @TableField("BUDGET_NUMBER") + private String budgetNumber; + + /** + * 预算年度 + */ + @ApiModelProperty(value = "预算年度") + @TableField("BUDGET_YEAR") + private String budgetYear; + + /** + * 预算类型 + */ + @ApiModelProperty(value = "预算类型") + @TableField("BUDGET_TYPE") + private String budgetType; + /** + * 预算类别 + */ + @ApiModelProperty(value = "预算类别") + @TableField("BUDGET_KIND") + private String budgetKind; + /** + * 预算项目名称 + */ + @ApiModelProperty(value = "预算项目名称") + @TableField("BUDGET_ITEM_NAME") + private String budgetItemName; + /** + * 预算机构名称 + */ + @ApiModelProperty(value = "预算机构名称") + @TableField("BUDGET_ORG") + private String budgetOrg; + /** + * 预算金额 + */ + @ApiModelProperty(value = "预算金额") + @TableField("BUDGET_AMT") + private BigDecimal budgetAmt; + /** + * 总行预算归口管理部门 + */ + @ApiModelProperty(value = "总行预算归口管理部门") + @TableField("HEAD_BANK_MANGER_DEPT") + private String headBankMangerDept; + /** + * 预算说明 + */ + @ApiModelProperty(value = "预算说明") + @TableField("BUDGET_EXPLAIN") + private String budgetExplain; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + + /** + * 部门名称 + */ + @ApiModelProperty(value = "部门名称") + @TableField("DEPT_NAME") + private String deptName; + + /** + * 逻辑删除标识符;;0-删除,1-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;;0-删除,1-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + /** + * 状态(0-暂存,1-保存(终态不可编辑删除)) + */ + @ApiModelProperty(value = "状态(0-暂存,1-保存(终态不可编辑删除))") + @TableField("STATE") + private String state; + + /** + * 总行预算归口管理部门页面级联显示 + */ + @ApiModelProperty(value = "总行预算归口管理部门页面级联显示") + @TableField("MANGER_DEPT_FRONT") + private String mangerDeptFront; + + /** + * 预算机构名称页面级联显示 + */ + @ApiModelProperty(value = "预算机构名称页面级联显示") + @TableField("BUDGET_ORG_FRONT") + private String budgetOrgFront; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/Project.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/Project.java new file mode 100644 index 0000000..d5fba43 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/Project.java @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.NoArgsConstructor; +import org.security.ht.entity.common.BaseEntity; + +/** + * 项目管理-项目管理信息主表实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_PROJECT") +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "Project对象", description = "项目管理-项目管理信息主表") +public class Project extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 项目类型(1-建设类,2-服务类) + */ + @ApiModelProperty(value = "项目类型(1-建设类,2-服务类)") + @TableField("PROJECT_TYPE") + private String projectType; + /** + * 项目编码 + */ + @ApiModelProperty(value = "项目编码") + @TableField("PROJECT_CODE") + private String projectCode; + /** + * 项目名称 + */ + @ApiModelProperty(value = "项目名称") + @TableField("PROJECT_NAME") + private String projectName; + /** + * 项目描述 + */ + @ApiModelProperty(value = "项目描述") + @TableField("PROJECT_DESCRIBE") + private String projectDescribe; + /** + * 父级项目编码 + */ + @ApiModelProperty(value = "父级项目编码") + @TableField("PARENT_PROJECT_CODE") + private String parentProjectCode; + /** + * 关联预算编码 + */ + @ApiModelProperty(value = "关联预算编码") + @TableField("BUDGET_LINK_CODE") + private String budgetLinkCode; + /** + * 关联预算名称 + */ + @ApiModelProperty(value = "关联预算名称") + @TableField("BUDGET_LINK_NAME") + private String budgetLinkName; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + + /** + * 部门名称 + */ + @ApiModelProperty(value = "部门名称") + @TableField("DEPT_NAME") + private String deptName; + /** + * 逻辑删除标识符;0-删除;1-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-删除;1-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + /** + * 状态(0-暂存,1-保存(不可删除),2-结项确认(不可修改),3-项目考评中,4-项目考评结束) + */ + @ApiModelProperty(value = "状态(0-暂存,1-保存(不可删除),2-结项确认(不可修改),3-项目考评中,4-项目考评结束") + @TableField("STATE") + private String state; + + /** + * 项目节点状态(0-开始,1-立项,2-采购,3-合同,4-实施,5-验收, 6-结项,7-审阅通过) + */ + @ApiModelProperty(value = "项目节点状态(0-开始,1-立项,2-采购,3-合同,4-实施,5-验收, 6-结项,7-审阅通过)") + @TableField("PROJECT_STATUS") + private String projectStatus; + + /** + * 立项日期 + */ + @ApiModelProperty(value = "立项日期") + @TableField("PROJECT_INITIATION_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date projectInitiationDate; + /** + * 项目考评得分 + */ + @ApiModelProperty(value = "项目考评得分") + @TableField("SCORE") + private BigDecimal score; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectCheck.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectCheck.java new file mode 100644 index 0000000..096aec5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectCheck.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 项目管理-项目验收材料实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_PROJECT_CHECK") +@ApiModel(value = "ProjectCheck对象", description = "项目管理-项目验收材料") +public class ProjectCheck extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + @TableId("ID") + private String id; + /** + * 项目管理主表关联id + */ + @ApiModelProperty(value = "项目管理主表关联id") + @TableField("PROJECT_LINK_ID") + private String projectLinkId; + /** + * 项目验收时间 + */ + @ApiModelProperty(value = "项目验收时间") + @TableField("PROJECT_CHECK_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date projectCheckTime; + /** + * 相关附件 + */ + @ApiModelProperty(value = "相关附件") + @TableField("RELEVANT_ATTACHMENTS") + private String relevantAttachments; + /** + * 逻辑删除标识符;0-删除;1-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-删除;1-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectContract.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectContract.java new file mode 100644 index 0000000..449ede2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectContract.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 项目管理-项目合同实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_PROJECT_CONTRACT") +@ApiModel(value = "ProjectContract对象", description = "项目管理-项目合同") +public class ProjectContract extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + @TableId("ID") + private String id; + /** + * 项目管理主表关联id + */ + @ApiModelProperty(value = "项目管理主表关联id") + @TableField("PROJECT_LINK_ID") + private String projectLinkId; + + /** + * 合同金额 + */ + @ApiModelProperty(value = "合同金额") + @TableField("CONTRACT_AMT") + private BigDecimal contractAmt; + + /** + * 合同签订时间 + */ + @ApiModelProperty(value = "合同签订时间") + @TableField("CONTRACT_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date contractTime; + + /** + * 合同到期时间 + */ + @ApiModelProperty(value = "合同到期时间") + @TableField("contract_end_time") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date contractEndTime; + + /** + * 合同原件(法审后)(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "合同原件(法审后)(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("ORIGINAL_CONTRACT") + private String originalContract; + /** + * 补充材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "补充材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("SUPPLEMENT_MATERIALS") + private String supplementMaterials; + /** + * 逻辑删除标识符;0-删除;1-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-删除;1-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + + /** + * 相关方(外包公司)关联id + */ + @ApiModelProperty(value = "相关方(外包公司)关联id") + @TableField("OUT_COMPANY") + private String outCompany; + + /** + * 相关方(外包公司)名称 + */ + @ApiModelProperty(value = "相关方(外包公司)名称") + @TableField("OUT_COMPANY_NAME") + private String outCompanyName; + + /** + * 项目合同其他材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "项目合同其他材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("OTHER_MATERIALS") + private String otherMaterials; + + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + + /** + * 法审后意见(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "法审后意见(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("AFTER_LEGAL_DEVICE") + private String afterLegalDevice; + /** + * 是否含质保金 0-否 1-是 + */ + @ApiModelProperty(value = "是否含质保金 0-否 1-是") + @TableField("whether_qrm") + private String whetherQrm; + /** + * 质保金金额 + */ + @ApiModelProperty(value = "质保金金额") + @TableField("qr_money") + private BigDecimal qrMoney; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectEstablishment.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectEstablishment.java new file mode 100644 index 0000000..8130582 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectEstablishment.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 项目管理-项目立项资料实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_PROJECT_ESTABLISHMENT") +@ApiModel(value = "ProjectEstablishment对象", description = "项目管理-项目立项资料") +public class ProjectEstablishment extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + @TableId("ID") + private String id; + /** + * 项目管理主表关联id + */ + @ApiModelProperty(value = "项目管理主表关联id") + @TableField("PROJECT_LINK_ID") + private String projectLinkId; + /** + * 项目立项时间 + */ + @ApiModelProperty(value = "项目立项时间") + @TableField("PROJECT_ESTABLISHMENT_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date projectEstablishmentTime; + /** + * 项目立项图纸(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "项目立项图纸(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("PROJECT_ESTABLISHMENT_DRAWING") + private String projectEstablishmentDrawing; + /** + * 项目立项造价材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "项目立项造价材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("MANUFACTURING_COST_MATERIALS") + private String manufacturingCostMaterials; + /** + * 项目立项材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "项目立项材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("PROJECT_ESTABLISHMENT_MATERIALS") + private String projectEstablishmentMaterials; + /** + * 项目立项财审会材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "项目立项财审会材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("FINANCIAL_AUDIT_MATERIALS") + private String financialAuditMaterials; + /** + * 逻辑删除标识符;0-删除;1-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-删除;1-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + + /** + * 项目立项其他材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "项目立项其他材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("OTHER_MATERIALS") + private String otherMaterials; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectImplementation.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectImplementation.java new file mode 100644 index 0000000..e64f05b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectImplementation.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 项目管理-项目实施材料实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_PROJECT_IMPLEMENTATION") +@ApiModel(value = "ProjectImplementation对象", description = "项目管理-项目实施材料") +public class ProjectImplementation extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + @TableId("ID") + private String id; + /** + * 项目管理主表关联id + */ + @ApiModelProperty(value = "项目管理主表关联id") + @TableField("PROJECT_LINK_ID") + private String projectLinkId; + /** + * 项目开始实施时间 + */ + @ApiModelProperty(value = "项目开始实施时间") + @TableField("PROJECT_IMPLEMENTATION_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date projectImplementationTime; + /** + * 实施文件(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "实施文件(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("IMPLEMENTATION_MATERIALS") + private String implementationMaterials; + /** + * 工程变更单(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "工程变更单(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("ENGINEERING_LETTER") + private String engineeringLetter; + /** + * 逻辑删除标识符;0-删除;1-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-删除;1-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + + /** + * 设备合格文件(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "设备合格文件(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("DEVICE_QUALIFIED_MATERIALS") + private String deviceQualifiedMaterials; + + /** + * 项目实施其他材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "项目实施其他材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("OTHER_MATERIALS") + private String otherMaterials; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectOverHistory.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectOverHistory.java new file mode 100644 index 0000000..bb7a1d4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectOverHistory.java @@ -0,0 +1,43 @@ +package org.security.trans.projectBudgetManagement.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.security.ht.entity.common.BaseEntity; + +import java.io.Serializable; + +/** + * @author :wzf + * @apiNote :项目预算管理-项目结项流水记录 + * @since :Created in 2022/9/19 19:53 + */ +@Data +@TableName("t_project_over_history") +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "ProjectOverHistory对象", description = "项目预算管理-项目结项流水记录") +public class ProjectOverHistory extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /**ID*/ + @TableId("id") + private String id; + /**项目关联id*/ + @TableField("project_link_id") + private String projectLinkId; + /**操作状态(1-项目结项,2-项目驳回,3-同意结项)*/ + @TableField("operation_status") + private Integer operationStatus; + /**本节点操作人*/ + @TableField("operation_user") + private String operationUser; + /**备注*/ + @TableField("remark") + private String remark; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectPayPlan.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectPayPlan.java new file mode 100644 index 0000000..e686220 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectPayPlan.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 项目管理-付款计划及跟踪实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_PROJECT_PAY_PLAN") +@ApiModel(value = "ProjectPayPlan对象", description = "项目管理-付款计划及跟踪") +public class ProjectPayPlan extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 项目管理主表关联id + */ + @ApiModelProperty(value = "项目管理主表关联id") + @TableField("PROJECT_LINK_ID") + private String projectLinkId; + /** + * 计划付款时间 + */ + @ApiModelProperty(value = "计划付款时间") + @TableField("PLAN_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date planTime; + /** + * 计划付款金额 + */ + @ApiModelProperty(value = "计划付款金额") + @TableField("PLAN_AMT") + private BigDecimal planAmt; + /** + * 实际付款时间 + */ + @ApiModelProperty(value = "实际付款时间") + @TableField("ACTUAL_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date actualTime; + /** + * 实际付款金额 + */ + @ApiModelProperty(value = "实际付款金额") + @TableField("ACTUAL_AMT") + private BigDecimal actualAmt; + /** + * 付款阶段 + */ + @ApiModelProperty(value = "付款阶段") + @TableField("PAYMENT_STAGE") + private String paymentStage; + /** + * 发票(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "发票(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("INVOICE") + private String invoice; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARK") + private String remark; + /** + * 逻辑删除标识符;0-删除;1-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-删除;1-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 付款类型 1-质保金付款 2-其他 3-合同第X期 + */ + @ApiModelProperty(value = "付款类型 1-质保金付款 2-其他 3-合同第X期") + @TableField("TYPE") + private String type; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectPurchase.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectPurchase.java new file mode 100644 index 0000000..cc006b0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/entity/ProjectPurchase.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; + +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 项目管理-项目采购材料实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@TableName("T_PROJECT_PURCHASE") +@ApiModel(value = "ProjectPurchase对象", description = "项目管理-项目采购材料") +public class ProjectPurchase extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + @TableId("ID") + private String id; + /** + * 项目管理主表关联id + */ + @ApiModelProperty(value = "项目管理主表关联id") + @TableField("PROJECT_LINK_ID") + private String projectLinkId; + /** + * 采购时间 + */ + @ApiModelProperty(value = "采购时间") + @TableField("PURCHASE_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date purchaseTime; + + /** + * 公开招标材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "公开招标材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("PUBLIC_BIDDING_MATERIALS") + private String publicBiddingMaterials; + /** + * 邀请招标材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "邀请招标材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("INVITE_BIDDING_MATERIALS") + private String inviteBiddingMaterials; + /** + * 询价采购材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "询价采购材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("INQUIRY_PURCHASE_MATERIALS") + private String inquiryPurchaseMaterials; + /** + * 单一来源采购材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "单一来源采购材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("SINGLE_SOURCE_PURCHASE_MATERIALS") + private String singleSourcePurchaseMaterials; + /** + * 竞争性谈判材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "竞争性谈判材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("COMPETITIVE_NEGOTIATION_MATERIALS") + private String competitiveNegotiationMaterials; + /** + * 逻辑删除标识符;0-删除;1-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-删除;1-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + /** + * 采购金额 + */ + @ApiModelProperty(value = "采购金额") + @TableField("PURCHASE_AMT") + private BigDecimal purchaseAmt; + + /** + * 项目采购其他材料(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "项目采购其他材料(存放该附件的标识符,对应于附件表里的‘group_name’)") + @TableField("OTHER_MATERIALS") + private String otherMaterials; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/BudgetItemMapper.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/BudgetItemMapper.java new file mode 100644 index 0000000..69a62fd --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/BudgetItemMapper.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.projectBudgetManagement.dto.BudgetItemDTO; +import org.security.trans.projectBudgetManagement.entity.BudgetItem; +import org.security.trans.projectBudgetManagement.vo.BudgetItemVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.vo.DictDataVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 项目管理-预算管理信息表 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface BudgetItemMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param budgetItemDTO + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectBudgetItemPage(IPage page, @Param("budgetItemDTO") BudgetItemDTO budgetItemDTO); + + /** + * 获取字典值 + * @param keyName 字典编码标识符 + * @return + */ + List getDictData(@Param("keyName") String keyName); + + /** + * 根据字典id获取字典值 + * @param dictId + * @return + */ + String getDictName(@Param("dictId") String dictId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/BudgetItemMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/BudgetItemMapper.xml new file mode 100644 index 0000000..802b477 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/BudgetItemMapper.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectCheckMapper.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectCheckMapper.java new file mode 100644 index 0000000..ad37c82 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectCheckMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.mapper; + +import org.security.trans.projectBudgetManagement.entity.ProjectCheck; +import org.security.trans.projectBudgetManagement.vo.ProjectCheckVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 项目管理-项目验收材料 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface ProjectCheckMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param projectCheck + * @return + */ + List selectProjectCheckPage(IPage page, ProjectCheckVO projectCheck); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectCheckMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectCheckMapper.xml new file mode 100644 index 0000000..9a31f37 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectCheckMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectContractMapper.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectContractMapper.java new file mode 100644 index 0000000..5736c23 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectContractMapper.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.mapper; + +import org.security.trans.projectBudgetManagement.dto.ProjectContractDTO; +import org.security.trans.projectBudgetManagement.entity.ProjectContract; +import org.security.trans.projectBudgetManagement.vo.ProjectContractVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 项目管理-项目合同 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface ProjectContractMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param projectContractDTO + * @return + */ + List selectProjectContractPage(IPage page, ProjectContractDTO projectContractDTO); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectContractMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectContractMapper.xml new file mode 100644 index 0000000..2d76ff5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectContractMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectEstablishmentMapper.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectEstablishmentMapper.java new file mode 100644 index 0000000..4e0a54e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectEstablishmentMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.mapper; + +import org.security.trans.projectBudgetManagement.entity.ProjectEstablishment; +import org.security.trans.projectBudgetManagement.vo.ProjectEstablishmentVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 项目管理-项目立项资料 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface ProjectEstablishmentMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param projectEstablishment + * @return + */ + List selectProjectEstablishmentPage(IPage page, ProjectEstablishmentVO projectEstablishment); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectEstablishmentMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectEstablishmentMapper.xml new file mode 100644 index 0000000..32b23db --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectEstablishmentMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectImplementationMapper.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectImplementationMapper.java new file mode 100644 index 0000000..9bc8873 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectImplementationMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.mapper; + +import org.security.trans.projectBudgetManagement.entity.ProjectImplementation; +import org.security.trans.projectBudgetManagement.vo.ProjectImplementationVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 项目管理-项目实施材料 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface ProjectImplementationMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param projectImplementation + * @return + */ + List selectProjectImplementationPage(IPage page, ProjectImplementationVO projectImplementation); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectImplementationMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectImplementationMapper.xml new file mode 100644 index 0000000..4dd098a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectImplementationMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectMapper.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectMapper.java new file mode 100644 index 0000000..e68e1f2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectMapper.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.projectBudgetManagement.dto.ProjectDTO; +import org.security.trans.projectBudgetManagement.entity.Project; +import org.security.trans.projectBudgetManagement.vo.DictDataVO; +import org.security.trans.projectBudgetManagement.vo.ProjectVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 项目管理-项目管理信息主表 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface ProjectMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param projectDTO + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectProjectPage(IPage page, @Param("projectDTO") ProjectDTO projectDTO); + + /** + * 获取关联预算项目名称 + * @param budgetLinkCode 预算编码 + * @return + */ + String getBudget(@Param("budgetLinkCode") String budgetLinkCode); + + + /** + * + * @param deptId 机构id + * @param roleName 角色名称 + * @return + */ + List getSecurityUserIds(@Param("deptId") String deptId, @Param("roleName") String roleName); + + /** + * 获取当前登录人机构的安全员用户id + * @param deptId + * @return + */ + List getAimUserIds(@Param("deptId") String deptId); + + DictDataVO getDictData(@Param("keyName") String keyName); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectMapper.xml new file mode 100644 index 0000000..2584050 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectMapper.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectOverHistoryMapper.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectOverHistoryMapper.java new file mode 100644 index 0000000..a71bbf5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectOverHistoryMapper.java @@ -0,0 +1,11 @@ +package org.security.trans.projectBudgetManagement.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.security.trans.projectBudgetManagement.entity.ProjectOverHistory; + +/** + * @author :wzf + * @since :Created in 2022/9/19 20:01 + */ +public interface ProjectOverHistoryMapper extends BaseMapper { +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectOverHistoryMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectOverHistoryMapper.xml new file mode 100644 index 0000000..4425646 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectOverHistoryMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPayPlanMapper.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPayPlanMapper.java new file mode 100644 index 0000000..dc16cd4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPayPlanMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.mapper; + +import org.security.trans.projectBudgetManagement.entity.ProjectPayPlan; +import org.security.trans.projectBudgetManagement.vo.ProjectPayPlanVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 项目管理-付款计划及跟踪 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface ProjectPayPlanMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param projectPayPlan + * @return + */ + List selectProjectPayPlanPage(IPage page, ProjectPayPlanVO projectPayPlan); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPayPlanMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPayPlanMapper.xml new file mode 100644 index 0000000..a8cb952 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPayPlanMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPurchaseMapper.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPurchaseMapper.java new file mode 100644 index 0000000..6ae5672 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPurchaseMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.mapper; + +import org.security.trans.projectBudgetManagement.entity.ProjectPurchase; +import org.security.trans.projectBudgetManagement.vo.ProjectPurchaseVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 项目管理-项目采购材料 Mapper 接口 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface ProjectPurchaseMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param projectPurchase + * @return + */ + List selectProjectPurchasePage(IPage page, ProjectPurchaseVO projectPurchase); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPurchaseMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPurchaseMapper.xml new file mode 100644 index 0000000..c92ade9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/mapper/ProjectPurchaseMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IBudgetItemService.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IBudgetItemService.java new file mode 100644 index 0000000..7894753 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IBudgetItemService.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service; + +import org.security.trans.projectBudgetManagement.dto.BudgetItemDTO; +import org.security.trans.projectBudgetManagement.entity.BudgetItem; +import org.security.trans.projectBudgetManagement.vo.BudgetItemVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.vo.DictDataVO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 项目管理-预算管理信息表 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface IBudgetItemService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param budgetItemDTO + * @return + */ +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + IPage selectBudgetItemPage(IPage page, BudgetItemDTO budgetItemDTO); + + /** + * 新增预算 + * @param budgetItemDTO 预算详情 + * @return + */ + boolean saveData(BudgetItemDTO budgetItemDTO); + + /** + * 获取预算详情 + * @param id + * @return + */ + BudgetItemVO getData(String id); + + + /** + * 根据字典编码获取字典信息 + */ + List getDictData(String keyName); + + /** + * 获取相关父级预算信息 + * @return + */ + List getParentBudget(String deptId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectCheckService.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectCheckService.java new file mode 100644 index 0000000..946cb73 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectCheckService.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service; + +import org.security.trans.projectBudgetManagement.entity.ProjectCheck; +import org.security.trans.projectBudgetManagement.vo.ProjectCheckVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 项目管理-项目验收材料 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface IProjectCheckService extends IService { + /** + * 获取项目验收材料信息 + * @param id + * @return + */ + ProjectCheckVO getData(String id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectContractService.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectContractService.java new file mode 100644 index 0000000..38bb09c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectContractService.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service; + +import org.security.trans.projectBudgetManagement.dto.ProjectContractDTO; +import org.security.trans.projectBudgetManagement.entity.ProjectContract; +import org.security.trans.projectBudgetManagement.vo.ProjectContractVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * 项目管理-项目合同 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface IProjectContractService extends IService { + + + /** + * 获取项目合同信息 + * @param id + * @return + */ + List getDaya(String id); + /** + * 自定义分页 + * + * @param page + * @param projectContractDTO + * @return + */ + IPage selectProjectContractPage(IPage page, ProjectContractDTO projectContractDTO); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectEstablishmentService.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectEstablishmentService.java new file mode 100644 index 0000000..1eb79b7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectEstablishmentService.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service; + +import org.security.trans.projectBudgetManagement.entity.ProjectEstablishment; +import org.security.trans.projectBudgetManagement.vo.ProjectEstablishmentVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 项目管理-项目立项资料 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface IProjectEstablishmentService extends IService { + + /** + * 获取项目立项资料 + * @param id + * @return + */ + ProjectEstablishmentVO getData(String id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectImplementationService.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectImplementationService.java new file mode 100644 index 0000000..1898671 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectImplementationService.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service; + +import org.security.trans.projectBudgetManagement.entity.ProjectImplementation; +import org.security.trans.projectBudgetManagement.vo.ProjectImplementationVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 项目管理-项目实施材料 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface IProjectImplementationService extends IService { + + /** + * 获取项目立项详情 + * @param id + * @return + */ + ProjectImplementationVO getData(String id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectOverHistoryService.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectOverHistoryService.java new file mode 100644 index 0000000..44d6bac --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectOverHistoryService.java @@ -0,0 +1,11 @@ +package org.security.trans.projectBudgetManagement.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.trans.projectBudgetManagement.entity.ProjectOverHistory; + +/** + * @author :wzf + * @since :Created in 2022/9/19 19:58 + */ +public interface IProjectOverHistoryService extends IService { +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectPayPlanService.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectPayPlanService.java new file mode 100644 index 0000000..ff31d0a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectPayPlanService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service; + +import org.security.trans.projectBudgetManagement.entity.ProjectPayPlan; +import org.security.trans.projectBudgetManagement.vo.ProjectPayPlanVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 项目管理-付款计划及跟踪 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface IProjectPayPlanService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param projectPayPlan + * @return + */ + IPage selectProjectPayPlanPage(IPage page, ProjectPayPlanVO projectPayPlan); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectPurchaseService.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectPurchaseService.java new file mode 100644 index 0000000..d5e7b3c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectPurchaseService.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service; + +import org.security.trans.projectBudgetManagement.entity.ProjectPurchase; +import org.security.trans.projectBudgetManagement.vo.ProjectPurchaseVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 项目管理-项目采购材料 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface IProjectPurchaseService extends IService { + + /** + * 获取项目采购材料信息 + * @param id + * @return + */ + ProjectPurchaseVO getData(String id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectService.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectService.java new file mode 100644 index 0000000..4270b82 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/IProjectService.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service; + +import org.security.trans.projectBudgetManagement.dto.ProjectDTO; +import org.security.trans.projectBudgetManagement.dto.ProjectOverReviewDTO; +import org.security.trans.projectBudgetManagement.dto.ProjectPayPlanDTO; +import org.security.trans.projectBudgetManagement.entity.Project; +import org.security.trans.projectBudgetManagement.vo.ProjectContractVO; +import org.security.trans.projectBudgetManagement.vo.ProjectPayPlanVO; +import org.security.trans.projectBudgetManagement.vo.ProjectVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.projectBudgetManagement.vo.RemindDataVO; + +import java.text.ParseException; +import java.util.List; + +/** + * 项目管理-项目管理信息主表 服务类 + * + * @author BladeX + * @since 2022-08-05 + */ +public interface IProjectService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param projectDTO + * @return + */ + IPage selectProjectPage(IPage page, ProjectDTO projectDTO); + + /** + * 获取项目信息 + * @param id + * @return + */ + ProjectVO getData(String id); + + /** + * 保存项目相关信息 + * @param projectDTO + * @return + */ + boolean saveData(ProjectDTO projectDTO); + + /** + * 删除项目信息 + * @param toLongList 项目信息id + * @return + */ + boolean removeData(List toLongList); + + /** + * 获取父级项目信息 + * @return + */ + List getParentProject(); + + /** + * 项目管理-项目结项 + * @param id 项目id + * @return + */ + boolean projectOver(String id); + + /** + * 结项项目审阅 + * @param projectOverReviewDTO 结项项目审阅信息 + * @return + */ + boolean projectOverReview(ProjectOverReviewDTO projectOverReviewDTO); + + /** + * 首页-设备维保到期、项目付款计划时间到期、项目合同到期提醒 + */ + List getRemindData() throws ParseException; + + + ProjectPayPlanVO getProjectPayPlanData(String id); + + ProjectContractVO getProjectContractData(String id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/BudgetItemServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/BudgetItemServiceImpl.java new file mode 100644 index 0000000..f42cf70 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/BudgetItemServiceImpl.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.base.Preconditions; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.ht.entity.basic.Department; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.trans.projectBudgetManagement.dto.BudgetItemDTO; +import org.security.trans.projectBudgetManagement.entity.BudgetItem; +import org.security.trans.projectBudgetManagement.vo.BudgetItemVO; +import org.security.trans.projectBudgetManagement.mapper.BudgetItemMapper; +import org.security.trans.projectBudgetManagement.service.IBudgetItemService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.projectBudgetManagement.vo.DictDataVO; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * 项目管理-预算管理信息表 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Service +@Slf4j +@AllArgsConstructor +public class BudgetItemServiceImpl extends ServiceImpl implements IBudgetItemService { + + private final IDepartmentService departmentService; + private final IFileService fileService; + @Override + public IPage selectBudgetItemPage(IPage page, BudgetItemDTO budgetItemDTO) { + log.info("==============获取预算信息列表页数据开始=============="); + List vos = baseMapper.selectBudgetItemPage(page, budgetItemDTO); + if (Func.isNotEmpty(vos)){ + vos.forEach(item ->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + Department department = departmentService.getById(item.getBudgetOrg()); + item.setBudgetOrg(Func.isNotEmpty(department) ? department.getDeptName() : null); + item.setBudgetType(baseMapper.getDictName(item.getBudgetType())); + item.setBudgetKind(baseMapper.getDictName(item.getBudgetKind())); + }); + } + log.info("==============获取预算信息列表页数据结束=============="); + return page.setRecords(vos); + } + + @Override + public boolean saveData(BudgetItemDTO budgetItemDTO) { + log.info("==============保存/更新预算信息数据开始=============="); + BudgetItem budgetItem = Func.copy(budgetItemDTO, BudgetItem.class); + Preconditions.checkArgument(Func.isNotEmpty(budgetItem),"预算信息为空"); + budgetItem.setDeptId(AuthUtil.getDeptId()); + budgetItem.setDeptName(departmentService.getById(AuthUtil.getDeptId()).getDeptName()); + boolean b = this.saveOrUpdate(budgetItem); + log.info("==============保存/更新预算信息数据结束=============="); + return b; + } + + @Override + public BudgetItemVO getData(String id) { + log.info("==============获取预算详情信息数据开始=============="); + BudgetItem budgetItem = this.getById(id); + log.info("==============获取预算详情信息数据结束=============="); + return Func.copy(budgetItem, BudgetItemVO.class); + } + + @Override + public List getDictData(String keyName) { + return baseMapper.getDictData(keyName); + } + + @Override + public List getParentBudget(String deptId) { + log.info("==============获取父级预算信息数据开始=============="); + List budgetItemList = this.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(deptId),BudgetItem::getDeptId, deptId) + .eq(BudgetItem::getState,Constant.SUBMIT_TYPE_ONE)); + log.info("==============获取父级预算信息数据结束=============="); + return Func.copy(budgetItemList, BudgetItemVO.class); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectCheckServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectCheckServiceImpl.java new file mode 100644 index 0000000..0eb61c4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectCheckServiceImpl.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.trans.common.service.IFileService; +import org.security.trans.projectBudgetManagement.entity.ProjectCheck; +import org.security.trans.projectBudgetManagement.vo.ProjectCheckVO; +import org.security.trans.projectBudgetManagement.mapper.ProjectCheckMapper; +import org.security.trans.projectBudgetManagement.service.IProjectCheckService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +/** + * 项目管理-项目验收材料 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Service +@Slf4j +@AllArgsConstructor +public class ProjectCheckServiceImpl extends ServiceImpl implements IProjectCheckService { + + private final IFileService fileService; + + @Override + public ProjectCheckVO getData(String id) { + log.info("==============获取项目验收材料数据开始=============="); + ProjectCheck projectCheck = this.getOne(new QueryWrapper().lambda().eq(Func.isNotEmpty(id), ProjectCheck::getProjectLinkId, id)); + ProjectCheckVO vo = Func.copy(projectCheck, ProjectCheckVO.class); +// Preconditions.checkArgument(Func.isNotEmpty(vo),"项目验收材料数据为空"); + if (Func.isNotEmpty(vo)) { + //获取相关附件 + vo.setCheckAttachments(fileService.getAttachments(projectCheck.getId(), projectCheck.getRelevantAttachments())); + } + log.info("==============获取项目验收材料数据结束=============="); + return vo; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectContractServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectContractServiceImpl.java new file mode 100644 index 0000000..d392ff9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectContractServiceImpl.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.trans.common.service.IFileService; +import org.security.trans.projectBudgetManagement.dto.ProjectContractDTO; +import org.security.trans.projectBudgetManagement.entity.ProjectContract; +import org.security.trans.projectBudgetManagement.vo.ProjectContractVO; +import org.security.trans.projectBudgetManagement.mapper.ProjectContractMapper; +import org.security.trans.projectBudgetManagement.service.IProjectContractService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 项目管理-项目合同 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Service +@Slf4j +@AllArgsConstructor +public class ProjectContractServiceImpl extends ServiceImpl implements IProjectContractService { + + private final IFileService fileService; + + @Override + public List getDaya(String id) { + log.info("==============获取项目合同数据开始=============="); + List vos = new ArrayList<>(); + List list = this.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(id), ProjectContract::getProjectLinkId, id)); + if (Func.isNotEmpty(list)){ + list.forEach(item ->{ + ProjectContractVO vo = Func.copy(item, ProjectContractVO.class); + //获取相关附件 + vo.setContractAttachments(fileService.getAttachments(item.getId(), item.getOriginalContract())); + vo.setSupplementAttachments(fileService.getAttachments(item.getId(), item.getSupplementMaterials())); + vo.setLegalAttachments(fileService.getAttachments(item.getId(), item.getAfterLegalDevice())); + vo.setOtherAttachments(fileService.getAttachments(item.getId(), item.getOtherMaterials())); + vos.add(vo); + }); + } + log.info("==============获取项目合同数据结束=============="); + return vos; + } + + @Override + public IPage selectProjectContractPage(IPage page, ProjectContractDTO projectContractDTO) { + log.info("==============获取项目合同数据开始projectContractDTO:==============",projectContractDTO); + List vos = baseMapper.selectProjectContractPage(page, projectContractDTO); + log.info("==============获取项目合同数据结束=============="); + return page.setRecords(vos); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectEstablishmentServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectEstablishmentServiceImpl.java new file mode 100644 index 0000000..1ddd8df --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectEstablishmentServiceImpl.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.base.Preconditions; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.trans.common.service.IFileService; +import org.security.trans.projectBudgetManagement.entity.ProjectEstablishment; +import org.security.trans.projectBudgetManagement.vo.ProjectEstablishmentVO; +import org.security.trans.projectBudgetManagement.mapper.ProjectEstablishmentMapper; +import org.security.trans.projectBudgetManagement.service.IProjectEstablishmentService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +/** + * 项目管理-项目立项资料 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Service +@Slf4j +@AllArgsConstructor +public class ProjectEstablishmentServiceImpl extends ServiceImpl implements IProjectEstablishmentService { + + private final IFileService fileService; + + @Override + public ProjectEstablishmentVO getData(String id) { + log.info("==============获取项目立项资料数据开始=============="); + ProjectEstablishment projectEstablishment = this.getOne(new QueryWrapper().lambda().eq(Func.isNotEmpty(id), ProjectEstablishment::getProjectLinkId, id)); + ProjectEstablishmentVO vo = Func.copy(projectEstablishment, ProjectEstablishmentVO.class); + //获取相关附件 +// Preconditions.checkArgument(Func.isNotEmpty(vo),"项目立项资料数据为空"); + if (Func.isNotEmpty(vo)) { + vo.setDrawAttachments(fileService.getAttachments(projectEstablishment.getId(), projectEstablishment.getProjectEstablishmentDrawing())); + vo.setCostAttachments(fileService.getAttachments(projectEstablishment.getId(), projectEstablishment.getManufacturingCostMaterials())); + vo.setMaterialAttachments(fileService.getAttachments(projectEstablishment.getId(), projectEstablishment.getProjectEstablishmentMaterials())); + vo.setFinancialAttachments(fileService.getAttachments(projectEstablishment.getId(), projectEstablishment.getFinancialAuditMaterials())); + vo.setOtherAttachments(fileService.getAttachments(projectEstablishment.getId(), projectEstablishment.getOtherMaterials())); + } + log.info("==============获取项目立项资料数据结束=============="); + return vo; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectImplementationServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectImplementationServiceImpl.java new file mode 100644 index 0000000..ea4c9b3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectImplementationServiceImpl.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.base.Preconditions; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.trans.common.service.IFileService; +import org.security.trans.projectBudgetManagement.entity.ProjectImplementation; +import org.security.trans.projectBudgetManagement.vo.ProjectImplementationVO; +import org.security.trans.projectBudgetManagement.mapper.ProjectImplementationMapper; +import org.security.trans.projectBudgetManagement.service.IProjectImplementationService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +/** + * 项目管理-项目实施材料 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Service +@Slf4j +@AllArgsConstructor +public class ProjectImplementationServiceImpl extends ServiceImpl implements IProjectImplementationService { + + private final IFileService fileService; + + @Override + public ProjectImplementationVO getData(String id) { + log.info("==============获取项目实施材料数据开始=============="); + ProjectImplementation projectImplementation = this.getOne(new QueryWrapper().lambda().eq(Func.isNotEmpty(id), ProjectImplementation::getProjectLinkId, id)); + ProjectImplementationVO vo = Func.copy(projectImplementation, ProjectImplementationVO.class); + //获取相关附件 +// Preconditions.checkArgument(Func.isNotEmpty(vo),"项目实施材料数据为空"); + if (Func.isNotEmpty(vo)) { + vo.setEngineeringAttachments(fileService.getAttachments(projectImplementation.getId(), projectImplementation.getEngineeringLetter())); + vo.setImplementationAttachments(fileService.getAttachments(projectImplementation.getId(), projectImplementation.getImplementationMaterials())); + vo.setDeviceAttachments(fileService.getAttachments(projectImplementation.getId(), projectImplementation.getDeviceQualifiedMaterials())); + vo.setOtherAttachments(fileService.getAttachments(projectImplementation.getId(), projectImplementation.getOtherMaterials())); + } + log.info("==============获取项目实施材料数据结束=============="); + return vo; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectOverHistoryServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectOverHistoryServiceImpl.java new file mode 100644 index 0000000..3392ec9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectOverHistoryServiceImpl.java @@ -0,0 +1,19 @@ +package org.security.trans.projectBudgetManagement.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.trans.projectBudgetManagement.entity.ProjectOverHistory; +import org.security.trans.projectBudgetManagement.mapper.ProjectOverHistoryMapper; +import org.security.trans.projectBudgetManagement.service.IProjectOverHistoryService; +import org.springframework.stereotype.Service; + +/** + * @author :wzf + * @since :Created in 2022/9/19 19:58 + */ +@Service +@Slf4j +@AllArgsConstructor +public class ProjectOverHistoryServiceImpl extends ServiceImpl implements IProjectOverHistoryService { +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectPayPlanServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectPayPlanServiceImpl.java new file mode 100644 index 0000000..de8b3c3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectPayPlanServiceImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service.impl; + +import org.security.trans.projectBudgetManagement.entity.ProjectPayPlan; +import org.security.trans.projectBudgetManagement.vo.ProjectPayPlanVO; +import org.security.trans.projectBudgetManagement.mapper.ProjectPayPlanMapper; +import org.security.trans.projectBudgetManagement.service.IProjectPayPlanService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 项目管理-付款计划及跟踪 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Service +public class ProjectPayPlanServiceImpl extends ServiceImpl implements IProjectPayPlanService { + + @Override + public IPage selectProjectPayPlanPage(IPage page, ProjectPayPlanVO projectPayPlan) { + return page.setRecords(baseMapper.selectProjectPayPlanPage(page, projectPayPlan)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectPurchaseServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectPurchaseServiceImpl.java new file mode 100644 index 0000000..0095c15 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectPurchaseServiceImpl.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.base.Preconditions; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.trans.common.service.IFileService; +import org.security.trans.projectBudgetManagement.entity.ProjectPurchase; +import org.security.trans.projectBudgetManagement.vo.ProjectPurchaseVO; +import org.security.trans.projectBudgetManagement.mapper.ProjectPurchaseMapper; +import org.security.trans.projectBudgetManagement.service.IProjectPurchaseService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +/** + * 项目管理-项目采购材料 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Service +@Slf4j +@AllArgsConstructor +public class ProjectPurchaseServiceImpl extends ServiceImpl implements IProjectPurchaseService { + + private final IFileService fileService; + + @Override + public ProjectPurchaseVO getData(String id) { + log.info("==============获取项目采购材料数据开始=============="); + ProjectPurchase projectPurchase = this.getOne(new QueryWrapper().lambda().eq(Func.isNotEmpty(id), ProjectPurchase::getProjectLinkId, id)); + ProjectPurchaseVO vo = Func.copy(projectPurchase, ProjectPurchaseVO.class); + //获取相关附件 +// Preconditions.checkArgument(Func.isNotEmpty(vo),"项目采购材料数据为空"); + if (Func.isNotEmpty(vo)) { + vo.setPublicBiddingAttachments(fileService.getAttachments(projectPurchase.getId(), projectPurchase.getPublicBiddingMaterials())); + vo.setCompetitiveAttachments(fileService.getAttachments(projectPurchase.getId(), projectPurchase.getCompetitiveNegotiationMaterials())); + vo.setInquiryAttachments(fileService.getAttachments(projectPurchase.getId(), projectPurchase.getInquiryPurchaseMaterials())); + vo.setInviteBiddingAttachments(fileService.getAttachments(projectPurchase.getId(), projectPurchase.getInviteBiddingMaterials())); + vo.setSingleSourceAttachments(fileService.getAttachments(projectPurchase.getId(), projectPurchase.getSingleSourcePurchaseMaterials())); + vo.setOtherAttachments(fileService.getAttachments(projectPurchase.getId(), projectPurchase.getOtherMaterials())); + } + log.info("==============获取项目采购材料数据开始=============="); + return vo; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectServiceImpl.java new file mode 100644 index 0000000..99b99fb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/service/impl/ProjectServiceImpl.java @@ -0,0 +1,614 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.google.common.base.Preconditions; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.config.CommonProperties; +import org.security.common.util.DataFormatUtil; +import org.security.ht.entity.basic.Department; +import org.security.ht.entity.basic.Device; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.basic.service.IDeviceService; +import org.security.trans.common.service.IFileService; +import org.security.trans.outsourcing.service.IOutCompanyService; +import org.security.trans.projectBudgetManagement.dto.ProjectDTO; +import org.security.trans.projectBudgetManagement.dto.ProjectOverReviewDTO; +import org.security.trans.projectBudgetManagement.entity.*; +import org.security.trans.projectBudgetManagement.service.*; +import org.security.trans.projectBudgetManagement.vo.*; +import org.security.trans.projectBudgetManagement.mapper.ProjectMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.service.IDeviceCategorySettingsService; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 项目管理-项目管理信息主表 服务实现类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Service +@Slf4j +@AllArgsConstructor +public class ProjectServiceImpl extends ServiceImpl implements IProjectService { + + private final IProjectPayPlanService projectPayPlanService; + private final IFileService fileService; + private final IProjectEstablishmentService projectEstablishmentService; + private final IProjectPurchaseService projectPurchaseService; + private final IProjectContractService projectContractService; + private final IProjectImplementationService projectImplementationService; + private final IProjectCheckService projectCheckService; + private final IProjectOverHistoryService projectOverHistoryService; + private final CommonProperties commonProperties; + private final IDepartmentService departmentService; + private final IOutCompanyService outCompanyService; + private final IBudgetItemService budgetItemService; + private final IDeviceCategorySettingsService deviceCategorySettingsService; + private final IDeviceService deviceService; + + @Override + public IPage selectProjectPage(IPage page, ProjectDTO projectDTO) { + log.info("==============获取项目列表数据开始=============="); + List vos = baseMapper.selectProjectPage(page, projectDTO); + //判断该登录用户是否具有项目结项同意或驳回权限 + if (Func.isNotEmpty(vos)) { + vos.forEach(item -> { + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + //是否具有项目结项驳回和同意权限(默认为2-无权限) + item.setOperateStatus(Constant.PROJECT_OVER_TWO); + //如果项目是结项状态,查询判断当前登录人是否有权限进行审阅 分支行的项目由其上级机构的安全员进行审阅,总行的项目由总行安全员进行审阅 + if (Constant.PROJECT_NODE_OVER.equals(item.getProjectStatus())) { + String deptIdId=item.getDeptId(); + Department department = departmentService.getDepartmentById(Long.valueOf(deptIdId)); + if(Func.isNotEmpty(department) && !"1".equals(department.getDeptCategory())){ + deptIdId =String.valueOf(department.getParentId()); + } + List aimUserIds = baseMapper.getSecurityUserIds(deptIdId, commonProperties.getProjectRoleName()); + if(aimUserIds.contains(String.valueOf(AuthUtil.getUser().getUserId()))){ + item.setOperateStatus(Constant.PROJECT_OVER_ONE); + } + } + }); + } + log.info("==============获取项目列表数据结束=============="); + return page.setRecords(vos); + } + + @Override + public ProjectVO getData(String id) { + log.info("==============获取项目主体信息及项目付款计划数据开始=============="); + Project project = this.getById(id); + //获取付款计划 + List payPlanList = projectPayPlanService.list(new QueryWrapper().lambda().eq(ProjectPayPlan::getProjectLinkId, id)); + List payPlanVOList = Func.copy(payPlanList, ProjectPayPlanVO.class); + if (Func.isNotEmpty(payPlanVOList)) { + payPlanVOList.forEach(item -> { + item.setPlanAmt(null == item.getPlanAmt() ? BigDecimal.ZERO : item.getPlanAmt().setScale(2, BigDecimal.ROUND_HALF_UP)); + item.setActualAmt(null == item.getActualAmt() ? BigDecimal.ZERO : item.getActualAmt().setScale(2, BigDecimal.ROUND_HALF_UP)); + //获取相关发票附件 + item.setRelevantAttachments(fileService.getAttachments(item.getId(), item.getInvoice())); + }); + } + ProjectVO vo = Func.copy(project, ProjectVO.class); + Preconditions.checkArgument(Func.isNotEmpty(vo), "没有相关的项目信息"); + vo.setPayPlanList(payPlanVOList); + log.info("==============获取项目主体信息及项目付款计划数据结束=============="); + return vo; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveData(ProjectDTO projectDTO) { + log.info("==============保存项目相关信息数据开始=============="); + String projectNode; + Project project = Func.copy(projectDTO, Project.class); + Preconditions.checkArgument(Func.isNotEmpty(project), "项目相关信息为空"); + project.setBudgetLinkName(baseMapper.getBudget(project.getBudgetLinkCode())); + project.setDeptId(AuthUtil.getDeptId()); + project.setDeptName(departmentService.getById(AuthUtil.getDeptId()).getDeptName()); + //项目开始节点/项目原始节点 + projectNode = Func.isNotEmpty(project.getProjectStatus()) ? project.getProjectStatus() : Constant.PROJECT_NODE_START; + //项目主体信息入库 + this.saveOrUpdate(project); + //付款计划入库 + if (Func.isNotEmpty(projectDTO.getPayPlanList())) { + savePayPlan(projectDTO, project); + } + //项目立项信息入库 + if (Func.isNotEmpty(projectDTO.getProjectEstablishment())) { + projectNode = Integer.parseInt(project.getProjectStatus()) > Integer.parseInt(Constant.PROJECT_NODE_ESTABLISHMENT) ? project.getProjectStatus() : Constant.PROJECT_NODE_ESTABLISHMENT; + saveProjectEstablishment(projectDTO, project); + } + //项目采购信息入库 + if (Func.isNotEmpty(projectDTO.getProjectPurchase())) { + projectNode = Integer.parseInt(project.getProjectStatus()) > Integer.parseInt(Constant.PROJECT_NODE_PURCHASE) ? project.getProjectStatus() : Constant.PROJECT_NODE_PURCHASE; + saveProjectPurchase(projectDTO, project); + } + //项目合同信息入库 + if (Func.isNotEmpty(projectDTO.getProjectContract())) { + projectNode = Integer.parseInt(project.getProjectStatus()) > Integer.parseInt(Constant.PROJECT_NODE_CONTRACT) ? project.getProjectStatus() : Constant.PROJECT_NODE_CONTRACT; + saveContract(projectDTO, project); + } + //项目实施信息入库 + if (Func.isNotEmpty(projectDTO.getProjectImplementation())) { + projectNode = Integer.parseInt(project.getProjectStatus()) > Integer.parseInt(Constant.PROJECT_NODE_IMPLEMENTATION) ? project.getProjectStatus() : Constant.PROJECT_NODE_IMPLEMENTATION; + saveImplementating(projectDTO, project); + } + //项目验收信息入库 + if (Func.isNotEmpty(projectDTO.getProjectCheck())) { + projectNode = Integer.parseInt(project.getProjectStatus()) > Integer.parseInt(Constant.PROJECT_NODE_CHECK) ? project.getProjectStatus() : Constant.PROJECT_NODE_CHECK; + saveProjectCheck(projectDTO, project); + } + project.setProjectStatus(projectNode); + this.updateById(project); + log.info("==============保存项目相关信息数据结束=============="); + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean removeData(List toLongList) { + log.info("==============删除项目相关信息数据开始=============="); + List list = new ArrayList<>(); + toLongList.forEach(item -> { + //删除付款计划及相关附件 + removePayPlan(list, item); + //删除项目立项相关信息 + removeProjectEstablishment(list, item); + //删除项目采购信息 + removeProjectPurchase(list, item); + //删除项目合同信息 + removeProjectContract(list, item); + //删除项目实施信息 + removeProjectImplementation(list, item); + //删除项目验收信息 + removeProjectCheck(list, item); + }); + //删除所有相关附件 + fileService.removeFileData(list); + //删除项目主体信息 + boolean b = this.removeByIds(toLongList); + log.info("==============删除项目相关信息数据结束=============="); + return b; + } + + /** + * 删除项目验收信息 + */ + private void removeProjectCheck(List list, Long item) { + ProjectCheck projectCheck = projectCheckService.getOne(new QueryWrapper().lambda().eq(ProjectCheck::getProjectLinkId, item)); + if (Func.isNotEmpty(projectCheck)) { + list.add(projectCheck.getId()); + projectCheckService.removeById(projectCheck.getId()); + } + } + + /** + * 删除项目实施信息 + */ + private void removeProjectImplementation(List list, Long item) { + ProjectImplementation projectImplementation = projectImplementationService.getOne(new QueryWrapper().lambda().eq(ProjectImplementation::getProjectLinkId, item)); + if (Func.isNotEmpty(projectImplementation)) { + list.add(projectImplementation.getId()); + projectImplementationService.removeById(projectImplementation.getId()); + } + } + + /** + * 删除项目合同信息 + */ + private void removeProjectContract(List list, Long item) { + List projectContractList = projectContractService.list(new QueryWrapper().lambda().eq(ProjectContract::getProjectLinkId, item)); + if (Func.isNotEmpty(projectContractList)) { + List projectContract = new ArrayList<>(); + projectContractList.forEach(item3 -> { + projectContract.add(item3.getId()); + }); + list.addAll(projectContract); + projectContractService.removeByIds(projectContract); + } + } + + /** + * 删除项目采购信息 + */ + private void removeProjectPurchase(List list, Long item) { + ProjectPurchase projectPurchase = projectPurchaseService.getOne(new QueryWrapper().lambda().eq(ProjectPurchase::getProjectLinkId, item)); + if (Func.isNotEmpty(projectPurchase)) { + list.add(projectPurchase.getId()); + projectPurchaseService.removeById(projectPurchase.getId()); + } + } + + /** + * 删除项目立项相关信息 + */ + private void removeProjectEstablishment(List list, Long item) { + ProjectEstablishment projectEstablishment = projectEstablishmentService.getOne(new QueryWrapper().lambda().eq(ProjectEstablishment::getProjectLinkId, item)); + if (Func.isNotEmpty(projectEstablishment)) { + list.add(projectEstablishment.getId()); + projectEstablishmentService.removeById(projectEstablishment.getId()); + } + } + + /** + * 删除付款计划及相关附件 + */ + private void removePayPlan(List list, Long item) { + List ProjectPayPlanList = projectPayPlanService.list(new QueryWrapper().lambda().eq(ProjectPayPlan::getProjectLinkId, item)); + if (Func.isNotEmpty(ProjectPayPlanList)) { + List payPlan = new ArrayList<>(); + ProjectPayPlanList.forEach(item2 -> { + payPlan.add(item2.getId()); + }); + list.addAll(payPlan); + projectPayPlanService.removeByIds(payPlan); + } + } + + @Override + public List getParentProject() { + log.info("==============获取相关父级项目相关信息数据开始=============="); + List list = this.list(new QueryWrapper().lambda().eq(Project::getDeptId, AuthUtil.getDeptId())); + List vos = Func.copy(list, ProjectVO.class); + log.info("==============获取相关父级项目相关信息数据结束=============="); + return vos; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean projectOver(String id) { + Project project = this.getById(id); + project.setProjectStatus(Constant.PROJECT_NODE_OVER); + //将项目节点变更为结项 + this.updateById(project); + //新增一条项目结项流水记录 + ProjectOverHistory projectOverHistory = setProjectOverHistory(id, Constant.PROJECT_OVER, null); + return projectOverHistoryService.save(projectOverHistory); + } + + /** + * 设置结项操作流水记录 + */ + private ProjectOverHistory setProjectOverHistory(String id, Integer aimStatus, String remark) { + ProjectOverHistory projectOverHistory = new ProjectOverHistory(); + projectOverHistory.setOperationStatus(aimStatus); + projectOverHistory.setProjectLinkId(id); + projectOverHistory.setRemark(remark); + projectOverHistory.setOperationUser(String.valueOf(AuthUtil.getUser().getUserId())); + return projectOverHistory; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean projectOverReview(ProjectOverReviewDTO projectOverReviewDTO) { + Project project = this.getById(projectOverReviewDTO.getId()); + //审阅-结项驳回,项目记录状态变为待结项状态 + if (Constant.PROJECT_OVER_REJECT.equals(projectOverReviewDTO.getReviewStatus())) { + project.setProjectStatus(Constant.PROJECT_NODE_CHECK); + this.updateById(project); + } + //审阅-同意结项,项目记录状态变为审阅通过状态 + if (Constant.PROJECT_OVER_AGREE.equals(projectOverReviewDTO.getReviewStatus())) { + project.setProjectStatus(Constant.PROJECT_NODE_REVIEW); + this.updateById(project); + } + //保存操作记录 + ProjectOverHistory projectOverHistory = setProjectOverHistory(projectOverReviewDTO.getId(), projectOverReviewDTO.getReviewStatus(), projectOverReviewDTO.getRemark()); + return projectOverHistoryService.save(projectOverHistory); + } + + @Override + public List getRemindData() throws ParseException { + ArrayList vos = new ArrayList<>(); + //获取当前登录人机构的安全员用户id + List list = baseMapper.getAimUserIds(AuthUtil.getDeptId()); + if (Func.isNotEmpty(list) && list.contains(String.valueOf(AuthUtil.getUser().getUserId()))) { + Date date = DataFormatUtil.getLocalDate(); + //获取设备维保提醒信息 + getDeviceRemindData(vos, date); + //获取项目付款计划提醒 + getProjectPayPlanRemindData(vos, date); + //合同到期提醒 + getProjectContractRemindData(vos, date); + + } + return vos; + } + + @Override + public ProjectPayPlanVO getProjectPayPlanData(String id) { + ProjectPayPlan projectPayPlan = projectPayPlanService.getById(id); + ProjectPayPlanVO projectPayPlanVO = Func.copy(projectPayPlan, ProjectPayPlanVO.class); + projectPayPlanVO.setProjectName(this.getById(projectPayPlan.getProjectLinkId()).getProjectName()); + projectPayPlanVO.setRelevantAttachments(fileService.getAttachments(projectPayPlan.getId(), projectPayPlan.getInvoice())); + return projectPayPlanVO; + } + + @Override + public ProjectContractVO getProjectContractData(String id) { + ProjectContract projectContract = projectContractService.getById(id); + ProjectContractVO projectContractVO = Func.copy(projectContract, ProjectContractVO.class); + projectContractVO.setProjectName(this.getById(projectContract.getProjectLinkId()).getProjectName()); + projectContractVO.setContractAttachments(fileService.getAttachments(projectContract.getId(), projectContract.getOriginalContract())); + projectContractVO.setSupplementAttachments(fileService.getAttachments(projectContract.getId(), projectContract.getSupplementMaterials())); + projectContractVO.setLegalAttachments(fileService.getAttachments(projectContract.getId(), projectContract.getAfterLegalDevice())); + projectContractVO.setOtherAttachments(fileService.getAttachments(projectContract.getId(), projectContract.getOtherMaterials())); + return projectContractVO; + } + + /* + * 合同到期提醒 + */ + private void getProjectContractRemindData(ArrayList vos, Date date) { + log.info("--------------------获取项目合同到期提醒开始--------------------"); + //获取合同到期提醒提前天数 + DictDataVO concatDeadlineRemind = baseMapper.getDictData(commonProperties.getConcatDeadlineRemindKeyName()); + if (Func.isNotEmpty(concatDeadlineRemind)) { + log.info("合同到期提醒提前天数[{}]",concatDeadlineRemind.getDictValue()); + Date startDate = getRemindStartDate(date, Integer.valueOf(concatDeadlineRemind.getDictValue())); + List projectContractList = projectContractService.list(new QueryWrapper().lambda() + .eq(ProjectContract::getDeptId, AuthUtil.getDeptId()) + .le(Func.isNotEmpty(startDate), ProjectContract::getContractEndTime, startDate) + .ge(Func.isNotEmpty(date), ProjectContract::getContractEndTime, date)); + log.info("即将到期的项目合同[{}]",projectContractList); + if (Func.isNotEmpty(projectContractList)) { + projectContractList.forEach(contract -> { + RemindDataVO vo = new RemindDataVO(); + vo.setId(contract.getId()); + vo.setType("contract"); + vo.setTypeName("项目合同到期提醒"); + vo.setTitle(this.getById(contract.getProjectLinkId()).getProjectName()); + vo.setDeadline(contract.getContractEndTime()); + vo.setDeptName(departmentService.getById(contract.getDeptId()).getDeptName()); + vos.add(vo); + }); + } + } + log.info("--------------------获取项目合同到期提醒结束--------------------"); + } + + /** + * 获取项目付款计划提醒 + */ + private void getProjectPayPlanRemindData(ArrayList vos, Date date) { + log.info("--------------------获取项目付款计划提醒开始--------------------"); + //获取付款计划提醒提前天数 + DictDataVO payPlanRemind = baseMapper.getDictData(commonProperties.getPayPlanRemindKeyName()); + if (Func.isNotEmpty(payPlanRemind)) { + log.info("付款计划提醒提前天数[{}]",payPlanRemind.getDictValue()); + Date startDate = getRemindStartDate(date, Integer.valueOf(payPlanRemind.getDictValue())); + List projectPayPlanList = projectPayPlanService.list(new QueryWrapper().lambda() + .eq(ProjectPayPlan::getDeptId, AuthUtil.getDeptId()) + .isNotNull(ProjectPayPlan::getPlanAmt) + .le(Func.isNotEmpty(startDate), ProjectPayPlan::getPlanTime, startDate) + .ge(Func.isNotEmpty(date), ProjectPayPlan::getPlanTime, date)); + log.info("即将到期的项目付款计划[{}]",projectPayPlanList); + if (Func.isNotEmpty(projectPayPlanList)) { + List collect = projectPayPlanList.stream().filter(item -> Func.isNotEmpty(item.getActualAmt()) && (item.getActualAmt().compareTo(item.getPlanAmt()) < 0)).collect(Collectors.toList()); + collect.forEach(payPlan -> { + RemindDataVO vo = new RemindDataVO(); + vo.setId(payPlan.getId()); + vo.setType("payPlan"); + vo.setTypeName("项目付款计划提醒"); + vo.setTitle(this.getById(payPlan.getProjectLinkId()).getProjectName()); + vo.setDeadline(payPlan.getPlanTime()); + vo.setDeptName(departmentService.getById(payPlan.getDeptId()).getDeptName()); + vos.add(vo); + }); + } + } + log.info("--------------------获取项目付款计划提醒结束--------------------"); + } + + /** + * 获取设备维保提醒信息 + */ + private void getDeviceRemindData(ArrayList vos, Date date) { + log.info("--------------------获取设备维保提醒信息开始--------------------"); + //获取设备类型提醒提前天数 + List deviceCategoryList = deviceCategorySettingsService.list(new QueryWrapper().lambda() + .eq(DeviceCategorySettings::getDelFlag, Constant.DELETE_FLAG_0) + .isNotNull(DeviceCategorySettings::getRemindDay)); + if (Func.isNotEmpty(deviceCategoryList)) { + List deviceTotalList = new ArrayList<>(); + deviceCategoryList.forEach(item -> { + log.info("设备类型[{}]的设备,维保提醒提前天数是[{}]天",item.getName(),item.getRemindDay()); + //根据设备类型获取具体设备信息 + Date startDate = getRemindStartDate(date, item.getRemindDay()); + List deviceList = deviceService.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(item.getId()), Device::getTypeId, item.getId()) + .eq(Device::getDepId, AuthUtil.getDeptId()) + .eq(Device::getUsageState, Constant.DEVICE_STATE_USE) + .le(Func.isNotEmpty(startDate), Device::getMaintenanceDate, startDate) + .ge(Func.isNotEmpty(date), Device::getMaintenanceDate, date)); + log.info("相关类型的设备信息为[{}]",deviceList); + deviceTotalList.addAll(deviceList); + }); + if (Func.isNotEmpty(deviceTotalList)) { + deviceTotalList.forEach(device -> { + RemindDataVO vo = new RemindDataVO(); + vo.setId(device.getId()); + vo.setType("device"); + vo.setTypeName("设备维保到期提醒"); + vo.setTitle(device.getName()); + vo.setDeadline(device.getMaintenanceDate()); + vo.setDeptName(departmentService.getById(device.getDepId()).getDeptName()); + vos.add(vo); + }); + } + } + log.info("--------------------获取设备维保提醒信息结束--------------------"); + } + + /** + * 获取提醒开始日期 + */ + private Date getRemindStartDate(Date date, int day) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DATE, day); + return calendar.getTime(); + } + + /** + * 项目验收信息入库 + */ + private void saveProjectCheck(ProjectDTO projectDTO, Project project) { + log.info("==============项目验收信息入库开始=============="); + ProjectCheck projectCheck = Func.copy(projectDTO.getProjectCheck(), ProjectCheck.class); + Preconditions.checkArgument(Func.isNotEmpty(projectCheck), "项目验收信息为空"); + projectCheck.setProjectLinkId(project.getId()); + projectCheckService.saveOrUpdate(projectCheck); + //保存相关附件 + fileService.saveAttachments(projectDTO.getProjectCheck().getCheckAttachments(), projectCheck.getId()); + log.info("==============项目验收信息入库结束=============="); + } + + /** + * 项目实施信息入库 + */ + private void saveImplementating(ProjectDTO projectDTO, Project project) { + log.info("==============项目实施信息入库开始=============="); + ProjectImplementation projectImplementation = Func.copy(projectDTO.getProjectImplementation(), ProjectImplementation.class); + Preconditions.checkArgument(Func.isNotEmpty(projectImplementation), "项目实施信息为空"); + projectImplementation.setProjectLinkId(project.getId()); + projectImplementationService.saveOrUpdate(projectImplementation); + //保存相关附件 + //项目实施文件 + fileService.saveAttachments(projectDTO.getProjectImplementation().getImplementationAttachments(), projectImplementation.getId()); + //工程变更单 + fileService.saveAttachments(projectDTO.getProjectImplementation().getEngineeringAttachments(), projectImplementation.getId()); + //设备合格资料 + fileService.saveAttachments(projectDTO.getProjectImplementation().getDeviceAttachments(), projectImplementation.getId()); + //项目实施其他材料 + fileService.saveAttachments(projectDTO.getProjectImplementation().getOtherAttachments(), projectImplementation.getId()); + log.info("==============项目实施信息入库结束=============="); + } + + /** + * 项目合同信息入库 + */ + private void saveContract(ProjectDTO projectDTO, Project project) { + log.info("==============项目合同信息入库开始=============="); + Preconditions.checkArgument(Func.isNotEmpty(projectDTO.getProjectContract()), "项目合同信息为空"); + projectDTO.getProjectContract().forEach(item -> { + ProjectContract projectContract = Func.copy(item, ProjectContract.class); + projectContract.setDeptId(AuthUtil.getDeptId()); + projectContract.setProjectLinkId(project.getId()); + projectContract.setOutCompanyName(Func.isNotEmpty(item.getOutCompany()) ? outCompanyService.getById(item.getOutCompany()).getOutCompanyName() : null); + projectContractService.saveOrUpdate(projectContract); + //保存相关附件 + //保存合同原件 + fileService.saveAttachments(item.getContractAttachments(), projectContract.getId()); + //保存补充材料 + fileService.saveAttachments(item.getSupplementAttachments(), projectContract.getId()); + //保存法审后意见 + fileService.saveAttachments(item.getLegalAttachments(), projectContract.getId()); + //保存项目合同其他材料 + fileService.saveAttachments(item.getOtherAttachments(), projectContract.getId()); + }); + log.info("==============项目合同信息入库结束=============="); + } + + /** + * 付款计划入库 + */ + private void savePayPlan(ProjectDTO projectDTO, Project project) { + log.info("==============付款计划入库开始=============="); + projectDTO.getPayPlanList().forEach(item -> { + ProjectPayPlan projectPayPlan = Func.copy(item, ProjectPayPlan.class); + projectPayPlan.setDeptId(AuthUtil.getDeptId()); + Preconditions.checkArgument(Func.isNotEmpty(projectPayPlan), "付款计划信息为空"); + projectPayPlan.setProjectLinkId(project.getId()); + projectPayPlanService.saveOrUpdate(projectPayPlan); + //保存发票相关附件 + fileService.saveAttachments(item.getInvoiceAttachments(), projectPayPlan.getId()); + }); + log.info("==============付款计划入库结束=============="); + } + + /** + * 项目采购信息入库 + */ + private void saveProjectPurchase(ProjectDTO projectDTO, Project project) { + log.info("==============项目采购信息入库开始=============="); + ProjectPurchase projectPurchase = Func.copy(projectDTO.getProjectPurchase(), ProjectPurchase.class); + Preconditions.checkArgument(Func.isNotEmpty(projectPurchase), "项目采购信息为空"); + projectPurchase.setProjectLinkId(project.getId()); + projectPurchaseService.saveOrUpdate(projectPurchase); + //保存相关附件 + //公开招标材料 + fileService.saveAttachments(projectDTO.getProjectPurchase().getPublicBiddingAttachments(), projectPurchase.getId()); + //邀请招标材料 + fileService.saveAttachments(projectDTO.getProjectPurchase().getInviteBiddingAttachments(), projectPurchase.getId()); + //询价采购材料 + fileService.saveAttachments(projectDTO.getProjectPurchase().getInquiryAttachments(), projectPurchase.getId()); + //单一来源采购材料 + fileService.saveAttachments(projectDTO.getProjectPurchase().getSingleSourceAttachments(), projectPurchase.getId()); + //竞争性谈判材料 + fileService.saveAttachments(projectDTO.getProjectPurchase().getCompetitiveAttachments(), projectPurchase.getId()); + //项目采购其他材料 + fileService.saveAttachments(projectDTO.getProjectPurchase().getOtherAttachments(), projectPurchase.getId()); + log.info("==============项目采购信息入库结束=============="); + } + + /** + * 项目立项信息入库 + */ + private void saveProjectEstablishment(ProjectDTO projectDTO, Project project) { + log.info("==============项目立项信息入库开始=============="); + ProjectEstablishment projectEstablishment = Func.copy(projectDTO.getProjectEstablishment(), ProjectEstablishment.class); + Preconditions.checkArgument(Func.isNotEmpty(projectEstablishment), "项目立项信息为空"); + projectEstablishment.setProjectLinkId(project.getId()); + projectEstablishmentService.saveOrUpdate(projectEstablishment); + //保存相关附件信息 + //项目立项图纸 + fileService.saveAttachments(projectDTO.getProjectEstablishment().getDrawAttachments(), projectEstablishment.getId()); + //项目立项造价材料 + fileService.saveAttachments(projectDTO.getProjectEstablishment().getCostAttachments(), projectEstablishment.getId()); + //项目立项材料 + fileService.saveAttachments(projectDTO.getProjectEstablishment().getMaterialAttachments(), projectEstablishment.getId()); + //项目财审材料 + fileService.saveAttachments(projectDTO.getProjectEstablishment().getFinancialAttachments(), projectEstablishment.getId()); + //项目立项其他材料 + fileService.saveAttachments(projectDTO.getProjectEstablishment().getOtherAttachments(), projectEstablishment.getId()); + log.info("==============项目立项信息入库结束=============="); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/BudgetItemVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/BudgetItemVO.java new file mode 100644 index 0000000..3d1263a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/BudgetItemVO.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.common.Constant; +import org.security.trans.projectBudgetManagement.entity.BudgetItem; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.springblade.core.secure.utils.AuthUtil; + +/** + * 项目管理-预算管理信息表视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "BudgetItemVO对象", description = "项目管理-预算管理信息表") +public class BudgetItemVO extends BudgetItem { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + private boolean editable; + // 是否可删除 + private boolean deletable; + + public boolean isEditable() { + if (Constant.SUBMIT_TYPE_ZERO.equals(this.getState()) && String.valueOf(AuthUtil.getUser().getUserId()).equals(this.getCreatedBy())){ + return true; + } + return false; + } + + public boolean isDeletable() { + if (Constant.SUBMIT_TYPE_ZERO.equals(this.getState()) && String.valueOf(AuthUtil.getUser().getUserId()).equals(this.getCreatedBy())){ + return true; + } + return false; + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/DictDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/DictDataVO.java new file mode 100644 index 0000000..6a0e78f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/DictDataVO.java @@ -0,0 +1,61 @@ +package org.security.trans.projectBudgetManagement.vo; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author :wzf + * @apiNote :业务字典信息 + * @since :Created in 2022/8/15 10:29 + */ +@Data +public class DictDataVO { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ApiModelProperty(value = "主键") + private Long id; + + /** + * 父主键 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "父主键") + private Long parentId; + + /** + * 字典码 + */ + @ApiModelProperty(value = "字典码") + private String code; + + /** + * 字典值 + */ + @ApiModelProperty(value = "字典值") + private String dictKey; + + /** + * 字典名称 + */ + @ApiModelProperty(value = "字典名称") + private String dictValue; + + /** + * 排序 + */ + @ApiModelProperty(value = "排序") + private Integer sort; + + /** + * 字典备注 + */ + @ApiModelProperty(value = "字典备注") + private String remark; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectCheckVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectCheckVO.java new file mode 100644 index 0000000..ad2e0a8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectCheckVO.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.vo; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectCheck; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 项目管理-项目验收材料视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProjectCheckVO对象", description = "项目管理-项目验收材料") +public class ProjectCheckVO extends ProjectCheck { + private static final long serialVersionUID = 1L; + + /** + * 验收材料相关附件 + */ + private List checkAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectContractVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectContractVO.java new file mode 100644 index 0000000..1da1ad3 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectContractVO.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.vo; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectContract; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 项目管理-项目合同视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProjectContractVO对象", description = "项目管理-项目合同") +public class ProjectContractVO extends ProjectContract { + private static final long serialVersionUID = 1L; + + private String projectName; + /** + * 合同原件 + */ + private List contractAttachments; + + /** + * 补充材料 + */ + private List supplementAttachments; + + /** + * 法审后意见 + */ + private List legalAttachments; + + /** + * 项目合同其他材料 + */ + private List otherAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectEstablishmentVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectEstablishmentVO.java new file mode 100644 index 0000000..d2a5d96 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectEstablishmentVO.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.vo; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectEstablishment; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 项目管理-项目立项资料视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProjectEstablishmentVO对象", description = "项目管理-项目立项资料") +public class ProjectEstablishmentVO extends ProjectEstablishment { + private static final long serialVersionUID = 1L; + + /** + * 项目立项图纸 + */ + private List drawAttachments; + + /** + * 项目造价材料 + */ + private List costAttachments; + + /** + * 项目立项材料 + */ + private List materialAttachments; + + /** + * 项目立项会审材料 + */ + private List financialAttachments; + + /** + * 项目立项其他材料 + */ + private List otherAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectImplementationVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectImplementationVO.java new file mode 100644 index 0000000..0b8d6f6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectImplementationVO.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.vo; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectImplementation; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 项目管理-项目实施材料视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProjectImplementationVO对象", description = "项目管理-项目实施材料") +public class ProjectImplementationVO extends ProjectImplementation { + private static final long serialVersionUID = 1L; + + /** + * 项目实施文件材料 + */ + private List implementationAttachments; + + /** + * 工程函 + */ + private List engineeringAttachments; + + /** + * 设备合格资料 + */ + private List deviceAttachments; + + /** + * 项目实施其他材料 + */ + private List otherAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectPayPlanVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectPayPlanVO.java new file mode 100644 index 0000000..39f2a85 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectPayPlanVO.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.vo; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectPayPlan; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 项目管理-付款计划及跟踪视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProjectPayPlanVO对象", description = "项目管理-付款计划及跟踪") +public class ProjectPayPlanVO extends ProjectPayPlan { + private static final long serialVersionUID = 1L; + + private String projectName; + + /** + * 相关附件 + */ + private List relevantAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectPurchaseVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectPurchaseVO.java new file mode 100644 index 0000000..7dd5b1a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectPurchaseVO.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.vo; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.projectBudgetManagement.entity.ProjectPurchase; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 项目管理-项目采购材料视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProjectPurchaseVO对象", description = "项目管理-项目采购材料") +public class ProjectPurchaseVO extends ProjectPurchase { + private static final long serialVersionUID = 1L; + + /** + * 公开招标材料 + */ + private List publicBiddingAttachments; + + /** + * 邀请招标材料 + */ + private List inviteBiddingAttachments; + + /** + * 询价采购材料 + */ + private List inquiryAttachments; + + /** + * 单一来源采购材料 + */ + private List singleSourceAttachments; + + /** + * 竞争性谈判材料 + */ + private List competitiveAttachments; + + /** + * 项目采购其他材料 + */ + private List otherAttachments; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectVO.java new file mode 100644 index 0000000..9fc43a6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/ProjectVO.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.projectBudgetManagement.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.common.Constant; +import org.security.trans.projectBudgetManagement.entity.Project; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.springblade.core.secure.utils.AuthUtil; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 项目管理-项目管理信息主表视图实体类 + * + * @author BladeX + * @since 2022-08-05 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ProjectVO对象", description = "项目管理-项目管理信息主表") +public class ProjectVO extends Project { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + /** + * 是否具有项目结项驳回和同意权限(1-有权限,2-无权限) + */ + private String operateStatus; + + /** + * 项目总合同金额 + */ + private BigDecimal concatAmtTotal; + + /** + * 是否为付款计划完成项目:1-是,2-支付未完成-仅质保金待付,3-支付未完成-其他待付 4-无付款计划 + */ + private int payStatus; + + /** + * 是否拥有编辑权限 + */ + private boolean editable; + // 是否可删除 + private boolean deletable; + + public boolean isEditable() { + if ((Constant.PROJECT_NODE_START.equals(this.getProjectStatus()) || Constant.PROJECT_NODE_ESTABLISHMENT.equals(this.getProjectStatus()) + || Constant.PROJECT_NODE_PURCHASE.equals(this.getProjectStatus()) || Constant.PROJECT_NODE_CONTRACT.equals(this.getProjectStatus()) + || Constant.PROJECT_NODE_IMPLEMENTATION.equals(this.getProjectStatus()) || Constant.PROJECT_NODE_CHECK.equals(this.getProjectStatus())) + && String.valueOf(AuthUtil.getUser().getUserId()).equals(this.getCreatedBy())){ + return true; + } + return false; + } + + public boolean isDeletable() { + if (Constant.SUBMIT_TYPE_ZERO.equals(this.getState()) && String.valueOf(AuthUtil.getUser().getUserId()).equals(this.getCreatedBy())){ + return true; + } + return false; + } + + /** + * 付款计划 + */ + private List payPlanList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/RemindDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/RemindDataVO.java new file mode 100644 index 0000000..391a81c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/projectBudgetManagement/vo/RemindDataVO.java @@ -0,0 +1,30 @@ +package org.security.trans.projectBudgetManagement.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author :wzf + * @apiNote :设备维保到期、项目付款计划时间到期、项目合同到期提醒 + * @since :Created in 2022/11/18 15:45 + */ +@Data +public class RemindDataVO implements Serializable { + + private String id; + + private String type; + + private String typeName; + + private String title; + + + private String deptName; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date deadline; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/publicityReport/controller/PublicityController.java b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/controller/PublicityController.java new file mode 100644 index 0000000..aec0ba0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/controller/PublicityController.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.publicityReport.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.security.common.util.XssUtils; +import org.security.trans.publicityReport.dto.PublicityDTO; +import org.security.trans.publicityReport.entity.Publicity; +import org.security.trans.publicityReport.service.IPublicityService; +import org.security.trans.publicityReport.vo.PublicityVO; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.math.BigDecimal; + +/** + * 宣传报道-宣传报道信息表 控制器 + * + * @author BladeX + * @since 2022-03-16 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/publicity") +@Api(value = "宣传报道-宣传报道信息表", tags = "宣传报道-宣传报道信息表接口") +public class PublicityController extends BladeController { + + private final IPublicityService publicityService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + Publicity detail = publicityService.getDetail(id); + return R.data(detail); + } + + /** + * 分页 宣传报道-宣传报道信息表 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入publicity") + public R> list(Publicity publicity, Query query) { + IPage pages = publicityService.page(Condition.getPage(query), Condition.getQueryWrapper(publicity)); + return R.data(pages); + } + + /** + * 自定义分页 宣传报道-宣传报道信息表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入publicity") + public R> page(PublicityDTO publicity, Query query) { + IPage pages = publicityService.selectPublicityPage(Condition.getPage(query), publicity); + return R.data(pages); + } + + /** + * 保存 宣传报道-宣传报道信息表 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入publicity") + public R save(@Valid @RequestBody PublicityDTO publicityDTO) { + return publicityService.savePublicity(publicityDTO); + } + + /** + * 发布 宣传报道-宣传报道信息表 + */ + @PostMapping("/handin") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "发布", notes = "传入publicity") + public R handin(@Valid @RequestBody PublicityDTO publicityDTO) { + return R.status(publicityService.handin(publicityDTO)); + } + + /** + * 删除 宣传报道-宣传报道信息表 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(publicityService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/publicityReport/dto/PublicityDTO.java b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/dto/PublicityDTO.java new file mode 100644 index 0000000..d4132ac --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/dto/PublicityDTO.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.publicityReport.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.publicityReport.entity.Publicity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 宣传报道-宣传报道信息表数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class PublicityDTO extends Publicity { + private static final long serialVersionUID = 1L; + /** + * 文件附件 + */ + private List fileList; + /** + * 图片附件 + */ + private List picList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/publicityReport/entity/Publicity.java b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/entity/Publicity.java new file mode 100644 index 0000000..405e9ce --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/entity/Publicity.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.publicityReport.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.entity.common.BaseEntity; + +import java.io.Serializable; +import java.util.Date; + +/** + * 宣传报道-宣传报道信息表实体类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Data +@TableName("T_PUBLICITY") +@ApiModel(value = "Publicity对象", description = "宣传报道-宣传报道信息表") +public class Publicity extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ApiModelProperty(value = "id") + @TableId("ID") + private String id; + /** + * 主题 + */ + @ApiModelProperty(value = "标题") + @TableField("TITLE") + private String title; + /** + * 简要描述 + */ + @ApiModelProperty(value = "简要描述") + @TableField("reportDescribe") + private String reportDescribe; + /** + * 图片附件group_name(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "图片附件存储路径") + @TableField("REPORT_IMG_ROUTE") + private String reportImgRoute; + /** + * 文件附件group_name(存放该附件的标识符,对应于附件表里的‘group_name’) + */ + @ApiModelProperty(value = "文件附件存储路径") + @TableField("REPORT_ENCLOSURE_ROUTE") + private String reportEnclosureRoute; + /** + * 报道日期 + */ + @ApiModelProperty(value = "报道日期") + @TableField("REPORT_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date reportDate; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;1-删除,0-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 状态 0-草稿 1-发布 + */ + @ApiModelProperty(value = "状态 0-草稿 1-发布") + @TableField("STATE") + private String state; + /** + * 备用字段2 + */ + @ApiModelProperty(value = "备用字段2") + @TableField("RESERVE2") + private String reserve2; + /** + * 备用字段3 + */ + @ApiModelProperty(value = "备用字段3") + @TableField("RESERVE3") + private String reserve3; + /** + * 备用字段4 + */ + @ApiModelProperty(value = "备用字段4") + @TableField("RESERVE4") + private String reserve4; + /** + * 备用字段5 + */ + @ApiModelProperty(value = "备用字段5") + @TableField("RESERVE5") + private String reserve5; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/publicityReport/mapper/PublicityMapper.java b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/mapper/PublicityMapper.java new file mode 100644 index 0000000..162d968 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/mapper/PublicityMapper.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.publicityReport.mapper; + +import org.security.trans.publicityReport.dto.PublicityDTO; +import org.security.trans.publicityReport.entity.Publicity; +import org.security.trans.publicityReport.vo.PublicityVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 宣传报道-宣传报道信息表 Mapper 接口 + * + * @author BladeX + * @since 2022-03-16 + */ +public interface PublicityMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param publicityDTO + * @return + */ + List selectPublicityPage(IPage page, PublicityDTO publicityDTO); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/publicityReport/mapper/PublicityMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/mapper/PublicityMapper.xml new file mode 100644 index 0000000..6bf8d07 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/mapper/PublicityMapper.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/publicityReport/service/IPublicityService.java b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/service/IPublicityService.java new file mode 100644 index 0000000..e2eddf1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/service/IPublicityService.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.publicityReport.service; + +import org.security.trans.publicityReport.dto.PublicityDTO; +import org.security.trans.publicityReport.entity.Publicity; +import org.security.trans.publicityReport.vo.PublicityVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.tool.api.R; + +/** + * 宣传报道-宣传报道信息表 服务类 + * + * @author BladeX + * @since 2022-03-16 + */ +public interface IPublicityService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param publicity + * @return + */ + IPage selectPublicityPage(IPage page, PublicityDTO publicity); + + /** + * 保存(新增或修改) + * + * @param publicity + * @return + */ + R savePublicity(PublicityDTO publicity); + /** + * 发布 + * + * @param publicity + * @return + */ + boolean handin(PublicityDTO publicity); + /** + * 查询详情 + * + * @param id + * @return + */ + PublicityVO getDetail(String id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/publicityReport/service/impl/PublicityServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/service/impl/PublicityServiceImpl.java new file mode 100644 index 0000000..4330f8c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/service/impl/PublicityServiceImpl.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.publicityReport.service.impl; + +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.trans.common.service.IFileService; +import org.security.trans.publicityReport.dto.PublicityDTO; +import org.security.trans.publicityReport.entity.Publicity; +import org.security.trans.publicityReport.mapper.PublicityMapper; +import org.security.trans.publicityReport.service.IPublicityService; +import org.security.trans.publicityReport.vo.PublicityVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 宣传报道-宣传报道信息表 服务实现类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Service +@Slf4j +@AllArgsConstructor +public class PublicityServiceImpl extends ServiceImpl implements IPublicityService { + private final IFileService fileService; + + @Override + public IPage selectPublicityPage(IPage page, PublicityDTO publicityDTO) { + List vos = baseMapper.selectPublicityPage(page, publicityDTO); + log.info("=======vos 1{}======",vos); + vos.forEach(item ->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + //获取宣传图 + item.setPicList(fileService.getAttachments(item.getId(), item.getReportImgRoute())); + //获取附件 + item.setFileList(fileService.getAttachments(item.getId(), item.getReportEnclosureRoute())); + }); + log.info("=======vos 2{}======",vos); + return page.setRecords(vos); + } + + @Override + public PublicityVO getDetail(String id){ + Publicity publicity = this.getById(id); + PublicityVO publicityVO = Func.copy(publicity,PublicityVO.class); + //获取宣传图 + publicityVO.setPicList(fileService.getAttachments(publicityVO.getId(), publicityVO.getReportImgRoute())); + //获取附件 + publicityVO.setFileList(fileService.getAttachments(publicityVO.getId(), publicityVO.getReportEnclosureRoute())); + return publicityVO; + } + + @Override + public R savePublicity(PublicityDTO publicity) { + if (Func.isNull(publicity.getDeptId()) || Func.isBlank(publicity.getDeptId())){ + publicity.setDeptId(AuthUtil.getDeptId()); + } + if(Func.isNull(publicity.getReportDate()) || Func.isEmpty(publicity.getReportDate())){ + publicity.setReportDate(DateUtil.date()); + } + publicity.setState(Constant.FORM_STATE_DRAFT); + super.saveOrUpdate(publicity); + //保存首页宣传图 + fileService.saveAttachments(publicity.getPicList(),publicity.getId()); + //保存相关附件 + fileService.saveAttachments(publicity.getFileList(),publicity.getId()); + return R.data(publicity); + } + + @Override + public boolean handin(PublicityDTO publicityDTO) { + R res = savePublicity(publicityDTO); + if (!res.isSuccess()) { + throw new ServiceException("保存失败!"); + } + Publicity publicity = res.getData(); + publicity.setState(Constant.FORM_STATE_VALID); + publicity.setReportDate(DateUtil.date()); + return super.updateById(publicity); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/publicityReport/vo/PublicityVO.java b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/vo/PublicityVO.java new file mode 100644 index 0000000..390bee7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/publicityReport/vo/PublicityVO.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.publicityReport.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.publicityReport.entity.Publicity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * 宣传报道-宣传报道信息表视图实体类 + * + * @author BladeX + * @since 2022-03-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "PublicityVO对象", description = "宣传报道-宣传报道信息表") +public class PublicityVO extends Publicity { + private static final long serialVersionUID = 1L; + + private MultipartFile file; + /** + * 文件附件 + */ + private List fileList; + /** + * 图片附件 + */ + private List picList; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccAlarmPushController.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccAlarmPushController.java new file mode 100644 index 0000000..2544d3f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccAlarmPushController.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.securityCommandCenter.dto.SccAlarmPushDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.securityCommandCenter.entity.SccAlarmPush; +import org.security.trans.securityCommandCenter.vo.SccAlarmPushVO; +import org.security.trans.securityCommandCenter.service.ISccAlarmPushService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 警情推送 控制器 + * + * @author BladeX + * @since 2022-07-13 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/sccalarmpush") +@Api(value = "警情推送", tags = "警情推送接口") +public class SccAlarmPushController extends BladeController { + + private final ISccAlarmPushService sccAlarmPushService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(sccAlarmPushService.getData(id)); + } + + + /** + * 自定义分页 警情推送 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入sccAlarmPush") + public R> page(SccAlarmPushDTO sccAlarmPushDTO, Query query) { + IPage pages = sccAlarmPushService.selectSccAlarmPushPage(Condition.getPage(query), sccAlarmPushDTO); + return R.data(pages); + } + + /** + * 新增/修改 警情推送 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入sccAlarmPush") + public R save(@Valid @RequestBody SccAlarmPushDTO sccAlarmPushDTO) { + return R.status(sccAlarmPushService.saveData(sccAlarmPushDTO)); + } + + + + /** + * 删除 警情推送 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(sccAlarmPushService.removeData(Func.toStrList(ids))); + } + + + /** + * 警情推送提报暂存 + */ + @PostMapping("/save-data") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "警情推送提报暂存", notes = "传入sccAlarmPush") + public R updateData(@Valid @RequestBody SccAlarmPushDTO sccAlarmPushDTO) { + return R.status(sccAlarmPushService.updateData(sccAlarmPushDTO)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccAnswerAlarmController.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccAnswerAlarmController.java new file mode 100644 index 0000000..2a075ae --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccAnswerAlarmController.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.securityCommandCenter.dto.SccAlarmPushDTO; +import org.security.trans.securityCommandCenter.dto.SccAnswerAlarmDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.securityCommandCenter.entity.SccAnswerAlarm; +import org.security.trans.securityCommandCenter.vo.SccAnswerAlarmVO; +import org.security.trans.securityCommandCenter.service.ISccAnswerAlarmService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 安保指挥中心-联系接警记录 控制器 + * + * @author BladeX + * @since 2022-07-06 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/sccansweralarm") +@Api(value = "安保指挥中心-联系接警记录", tags = "安保指挥中心-联系接警记录接口") +public class SccAnswerAlarmController extends BladeController { + + private final ISccAnswerAlarmService sccAnswerAlarmService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入sccAnswerAlarm") + public R detail(@PathVariable String id) { + return R.data(sccAnswerAlarmService.getData(id)); + } + + /** + * 自定义分页 安保指挥中心-联系接警记录 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入sccAnswerAlarm") + public R> page(SccAnswerAlarmDTO sccAnswerAlarmDTO, Query query) { + IPage pages = sccAnswerAlarmService.selectSccAnswerAlarmPage(Condition.getPage(query), sccAnswerAlarmDTO); + return R.data(pages); + } + + /** + * 新增/修改 安保指挥中心-联系接警记录 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入sccAnswerAlarm") + public R save(@Valid @RequestBody SccAnswerAlarmDTO sccAnswerAlarmDTO) { + return R.status(sccAnswerAlarmService.saveData(sccAnswerAlarmDTO)); + } + + /** + * 删除 安保指挥中心-联系接警记录 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(sccAnswerAlarmService.removeData(Func.toStrList(ids))); + } + + + /** + * 警情信息提报 + */ + @PostMapping("/handIn") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "警情信息提报", notes = "传入sccAlarmPushDTO") + public R handIn(@Valid @RequestBody SccAlarmPushDTO sccAlarmPushDTO) { + return sccAnswerAlarmService.handIn(sccAlarmPushDTO); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccCheckController.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccCheckController.java new file mode 100644 index 0000000..835c856 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccCheckController.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.securityCommandCenter.dto.SccCheckDTO; +import org.security.trans.securityCommandCenter.dto.SccCheckLinesDTO; +import org.security.trans.securityCommandCenter.vo.SccCheckLinesVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.securityCommandCenter.entity.SccCheck; +import org.security.trans.securityCommandCenter.vo.SccCheckVO; +import org.security.trans.securityCommandCenter.service.ISccCheckService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.text.ParseException; + +/** + * 安保指挥长中心-营业网点检查和自主银行检查记录 控制器 + * + * @author BladeX + * @since 2022-07-06 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/scccheck") +@Api(value = "安保指挥长中心-营业网点检查和自主银行检查记录", tags = "安保指挥长中心-营业网点检查和自主银行检查记录接口") +public class SccCheckController extends BladeController { + + private final ISccCheckService sccCheckService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(sccCheckService.getData(id)); + } + + + /** + * 自定义分页 安保指挥长中心-营业网点检查和自主银行检查记录 + */ + @PostMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入sccCheckDTO") + public R> page(@RequestBody SccCheckDTO sccCheckDTO, Query query) { + IPage pages = sccCheckService.selectSccCheckPage(Condition.getPage(query), sccCheckDTO); + return R.data(pages); + } + + /** + * 自定义分页 获取检查异常的日志记录 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入sccCheck") + public R> list(SccCheckLinesDTO sccCheckLinesDTO, Query query) { + IPage pages = sccCheckService.selectDetailPage(Condition.getPage(query), sccCheckLinesDTO); + return R.data(pages); + } + + /** + * 录入 安保指挥长中心-营业网点检查和自主银行检查记录 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入sccCheck") + public R save(@Valid @RequestBody SccCheckDTO sccCheckDTO) throws ParseException { + return R.status(sccCheckService.saveCheckData(sccCheckDTO)); + } + + /** + * 删除 安保指挥长中心-营业网点检查和自主银行检查记录 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(sccCheckService.removeData(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccCheckLinesController.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccCheckLinesController.java new file mode 100644 index 0000000..61b61e5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccCheckLinesController.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.securityCommandCenter.dto.SccCheckLinesDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import org.security.trans.securityCommandCenter.vo.SccCheckLinesVO; +import org.security.trans.securityCommandCenter.service.ISccCheckLinesService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 安保指挥中心-营业网点检查和自助银行检查记录明细 控制器 + * + * @author BladeX + * @since 2022-07-06 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/sccchecklines") +@Api(value = "安保指挥中心-营业网点检查和自助银行检查记录明细", tags = "安保指挥中心-营业网点检查和自助银行检查记录明细接口") +public class SccCheckLinesController extends BladeController { + + private final ISccCheckLinesService sccCheckLinesService; + + /** + * 获取检查异常记录项详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + return R.data(sccCheckLinesService.getData(id)); + } + + /** + * 营业网点对检查异常的记录进行整改结果提报 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入sccCheckLines") + public R update(@Valid @RequestBody SccCheckLinesDTO sccCheckLinesDTO) { + return R.status(sccCheckLinesService.updateData(sccCheckLinesDTO)); + } + + /** + * 检查记录明细删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(sccCheckLinesService.removeByIds(Func.toLongList(ids))); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccMsgSendController.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccMsgSendController.java new file mode 100644 index 0000000..d64588b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccMsgSendController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.securityCommandCenter.entity.SccMsgSend; +import org.security.trans.securityCommandCenter.vo.SccMsgSendVO; +import org.security.trans.securityCommandCenter.service.ISccMsgSendService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 安保指挥中心-警情推送记录 控制器 + * + * @author BladeX + * @since 2022-07-06 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/sccmsgsend") +@Api(value = "安保指挥中心-警情推送记录", tags = "安保指挥中心-警情推送记录接口") +public class SccMsgSendController extends BladeController { + + private final ISccMsgSendService sccMsgSendService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入sccMsgSend") + public R detail(SccMsgSend sccMsgSend) { + SccMsgSend detail = sccMsgSendService.getOne(Condition.getQueryWrapper(sccMsgSend)); + return R.data(detail); + } + + /** + * 分页 安保指挥中心-警情推送记录 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入sccMsgSend") + public R> list(SccMsgSend sccMsgSend, Query query) { + IPage pages = sccMsgSendService.page(Condition.getPage(query), Condition.getQueryWrapper(sccMsgSend)); + return R.data(pages); + } + + /** + * 自定义分页 安保指挥中心-警情推送记录 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入sccMsgSend") + public R> page(SccMsgSendVO sccMsgSend, Query query) { + IPage pages = sccMsgSendService.selectSccMsgSendPage(Condition.getPage(query), sccMsgSend); + return R.data(pages); + } + + /** + * 新增 安保指挥中心-警情推送记录 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入sccMsgSend") + public R save(@Valid @RequestBody SccMsgSend sccMsgSend) { + return R.status(sccMsgSendService.save(sccMsgSend)); + } + + /** + * 修改 安保指挥中心-警情推送记录 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入sccMsgSend") + public R update(@Valid @RequestBody SccMsgSend sccMsgSend) { + return R.status(sccMsgSendService.updateById(sccMsgSend)); + } + + /** + * 新增或修改 安保指挥中心-警情推送记录 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入sccMsgSend") + public R submit(@Valid @RequestBody SccMsgSend sccMsgSend) { + return R.status(sccMsgSendService.saveOrUpdate(sccMsgSend)); + } + + + /** + * 删除 安保指挥中心-警情推送记录 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(sccMsgSendService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccUnlocaleCheckController.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccUnlocaleCheckController.java new file mode 100644 index 0000000..fc1e4be --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccUnlocaleCheckController.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.securityCommandCenter.dto.ContinuedRecDataDTO; +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckDTO; +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckLineDTO; +import org.security.trans.securityCommandCenter.vo.ContinuedRecDataVO; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckLineVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckVO; +import org.security.trans.securityCommandCenter.service.ISccUnlocaleCheckService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.text.ParseException; + +/** + * 安保指挥中心-非现场检查整改通知书 控制器 + * + * @author BladeX + * @since 2022-07-06 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/sccunlocalecheck") +@Api(value = "安保指挥中心-非现场检查整改通知书", tags = "安保指挥中心-非现场检查整改通知书接口") +public class SccUnlocaleCheckController extends BladeController { + + private final ISccUnlocaleCheckService sccUnlocaleCheckService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入sccUnlocaleCheck") + public R detail(@PathVariable String id) { + return R.data(sccUnlocaleCheckService.getData(id)); + } + + /** + * 自定义分页 安保指挥中心-非现场检查整改通知书 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入sccUnlocaleCheck") + public R> page(SccUnlocaleCheckDTO sccUnlocaleCheckDTO, Query query) { + IPage pages = sccUnlocaleCheckService.selectSccUnlocaleCheckPage(Condition.getPage(query), sccUnlocaleCheckDTO); + return R.data(pages); + } + + /** + * 下发非现场检查整改通知书 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入sccUnlocaleCheck") + public R save(@Valid @RequestBody SccUnlocaleCheckDTO sccUnlocaleCheckDTO) { + return R.status(sccUnlocaleCheckService.saveData(sccUnlocaleCheckDTO)); + } + + /** + * 非现场检查整改结果暂存或提报 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入sccUnlocaleCheck") + public R update(@Valid @RequestBody SccUnlocaleCheckDTO sccUnlocaleCheckDTO) throws ParseException { + return R.status(sccUnlocaleCheckService.handInData(sccUnlocaleCheckDTO)); + } + + + /** + * 删除 安保指挥中心-非现场检查整改通知书 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(sccUnlocaleCheckService.removeData(Func.toLongList(ids))); + } + + + /** + * 获取持续整改的整改记录 + */ + @GetMapping("/continued/page") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "分页", notes = "传入Status和state") + public R> getContinuedPage(Query query,ContinuedRecDataDTO continuedRecDataDTO) { + IPage pages = sccUnlocaleCheckService.getContinuedPage(Condition.getPage(query),continuedRecDataDTO); + return R.data(pages); + } + + /** + * 获取持续整改记录详情 + */ + @GetMapping("/continued/{id}") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "详情", notes = "传入sccUnlocaleCheck") + public R getContinuedDetail(@PathVariable String id) { + return R.data(sccUnlocaleCheckService.getContinuedDetail(id)); + } + + + /** + * 持续整改提报 + */ + @PostMapping("/continued/handIn") + @ApiOperationSupport(order = 11) + @ApiOperation(value = "持续整改提报", notes = "传入sccUnlocaleCheck") + public R handInContinuedRec(@Valid @RequestBody SccUnlocaleCheckLineDTO sccUnlocaleCheckLineDTO) throws ParseException { + return R.status(sccUnlocaleCheckService.handInContinuedRec(sccUnlocaleCheckLineDTO)); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccUnlocaleCheckLineController.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccUnlocaleCheckLineController.java new file mode 100644 index 0000000..6a849f0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/controller/SccUnlocaleCheckLineController.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckLineDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckLineVO; +import org.security.trans.securityCommandCenter.service.ISccUnlocaleCheckLineService; +import org.springblade.core.boot.ctrl.BladeController; + +/** + * 安保指挥中心-非现场检查整改明细 控制器 + * + * @author BladeX + * @since 2022-07-06 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/sccunlocalecheckline") +@Api(value = "安保指挥中心-非现场检查整改明细", tags = "安保指挥中心-非现场检查整改明细接口") +public class SccUnlocaleCheckLineController extends BladeController { + + private final ISccUnlocaleCheckLineService sccUnlocaleCheckLineService; + + /** + * 详情 + */ + @GetMapping("/detail/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入sccUnlocaleCheckLine") + public R detail(@PathVariable String id) { + return R.data(sccUnlocaleCheckLineService.getData(id)); + } + + /** + * 分页 安保指挥中心-非现场检查整改明细 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入sccUnlocaleCheckLine") + public R> list(SccUnlocaleCheckLine sccUnlocaleCheckLine, Query query) { + IPage pages = sccUnlocaleCheckLineService.page(Condition.getPage(query), Condition.getQueryWrapper(sccUnlocaleCheckLine)); + return R.data(pages); + } + + /** + * 自定义分页 安保指挥中心-非现场检查整改明细 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入sccUnlocaleCheckLine") + public R> page(SccUnlocaleCheckLineVO sccUnlocaleCheckLine, Query query) { + IPage pages = sccUnlocaleCheckLineService.selectSccUnlocaleCheckLinePage(Condition.getPage(query), sccUnlocaleCheckLine); + return R.data(pages); + } + + /** + * 新增 安保指挥中心-非现场检查整改明细 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入sccUnlocaleCheckLine") + public R save(@Valid @RequestBody SccUnlocaleCheckLineDTO sccUnlocaleCheckLineDTO) { + return R.status(sccUnlocaleCheckLineService.saveData(sccUnlocaleCheckLineDTO)); + } + + /** + * 修改 安保指挥中心-非现场检查整改明细 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入sccUnlocaleCheckLine") + public R update(@Valid @RequestBody SccUnlocaleCheckLine sccUnlocaleCheckLine) { + return R.status(sccUnlocaleCheckLineService.updateById(sccUnlocaleCheckLine)); + } + + /** + * 新增或修改 安保指挥中心-非现场检查整改明细 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入sccUnlocaleCheckLine") + public R submit(@Valid @RequestBody SccUnlocaleCheckLine sccUnlocaleCheckLine) { + return R.status(sccUnlocaleCheckLineService.saveOrUpdate(sccUnlocaleCheckLine)); + } + + + /** + * 删除 安保指挥中心-非现场检查整改明细 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(sccUnlocaleCheckLineService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/ContinuedRecDataDTO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/ContinuedRecDataDTO.java new file mode 100644 index 0000000..70dce17 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/ContinuedRecDataDTO.java @@ -0,0 +1,23 @@ +package org.security.trans.securityCommandCenter.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author :wzf + * @since :Created in 2022/9/28 20:47 + */ +@Data +public class ContinuedRecDataDTO implements Serializable { + + /** + * 业务状态 + */ + private String status; + + /** + * 流程状态 + */ + private String state; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccAlarmPushDTO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccAlarmPushDTO.java new file mode 100644 index 0000000..86f5047 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccAlarmPushDTO.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccAlarmPush; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 警情推送数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SccAlarmPushDTO extends SccAlarmPush { + private static final long serialVersionUID = 1L; + + /** + * 菜单模块标识符 0-推送警情,1-接收警情信息 + */ + private String menuType; + + /** + * 提报或暂存标识符 0-暂存,1-推送警情,2-警情信息处理提报 + */ + private String submitType; + + + /** + * 相关附件 + */ + private List relevantAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccAnswerAlarmDTO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccAnswerAlarmDTO.java new file mode 100644 index 0000000..ebe0c20 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccAnswerAlarmDTO.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccAnswerAlarm; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 安保指挥中心-联系接警记录数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SccAnswerAlarmDTO extends SccAnswerAlarm { + private static final long serialVersionUID = 1L; + + /** + * 警情推送是否推送标识符 0-暂存,1-警情推送,2-办结 + */ + private String submitType; + + /** + * 相关附件 + */ + private List relevantAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccCheckDTO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccCheckDTO.java new file mode 100644 index 0000000..b1d9b46 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccCheckDTO.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.dto; + +import org.security.trans.securityCommandCenter.entity.SccCheck; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 安保指挥长中心-营业网点检查和自主银行检查记录数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SccCheckDTO extends SccCheck { + private static final long serialVersionUID = 1L; + + /** + * 模块标识符 + */ + private String moduleType; + + + /** + * 检查日志明细 + */ + private List sccCheckLinesDTOList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccCheckLinesDTO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccCheckLinesDTO.java new file mode 100644 index 0000000..fdbac58 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccCheckLinesDTO.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +/** + * 安保指挥中心-营业网点检查和自助银行检查记录明细数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SccCheckLinesDTO extends SccCheckLines { + private static final long serialVersionUID = 1L; + + /** + * 提报或暂存标识符 0-暂存,1-提报 + */ + private String submitType; + + /** + * 检查类型;1-营业网点检查、2-自助银行检查 + */ + @ApiModelProperty(value = "检查类型;1-营业网点检查、2-自助银行检查") + private String checkType; + + /** + * 值班人员 + */ + @ApiModelProperty(value = "值班人员") + private String personOnDuty; + /** + * 值班时间 + */ + @ApiModelProperty(value = "值班时间") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GTM + 8") + private Date dutyTime; + + /** + * 相关附件 + */ + private List relevantAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccMsgSendDTO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccMsgSendDTO.java new file mode 100644 index 0000000..576e5d6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccMsgSendDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.dto; + +import org.security.trans.securityCommandCenter.entity.SccMsgSend; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 安保指挥中心-警情推送记录数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SccMsgSendDTO extends SccMsgSend { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccUnlocaleCheckDTO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccUnlocaleCheckDTO.java new file mode 100644 index 0000000..05e64ae --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccUnlocaleCheckDTO.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; + +import java.util.List; + +/** + * 安保指挥中心-非现场检查整改通知书数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SccUnlocaleCheckDTO extends SccUnlocaleCheck { + private static final long serialVersionUID = 1L; + + /** + * 模块标识符 + */ + private String moduleType; + + /** + * 菜单模块标识符 0-任务下发,1-任务上报 + */ + private String menuType; + + /** + * 提报或暂存标识符 0-暂存,1-提报 + */ + private String submitType; + + /** + * 相关附件 + */ + private List relevantAttachments; + + /** + * 检查整改明细 + */ + private List sccUnlocaleCheckLineDTOList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccUnlocaleCheckLineDTO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccUnlocaleCheckLineDTO.java new file mode 100644 index 0000000..13f1e55 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/dto/SccUnlocaleCheckLineDTO.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.dto; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 安保指挥中心-非现场检查整改明细数据传输对象实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SccUnlocaleCheckLineDTO extends SccUnlocaleCheckLine { + private static final long serialVersionUID = 1L; + + /** + * 可持续整改标识(1-普通整改,2-持续整改) + */ + private String recordFlag; + + /** + * 相关附件 + */ + private List relevantAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccAlarmPush.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccAlarmPush.java new file mode 100644 index 0000000..59e653e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccAlarmPush.java @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; +import org.security.ht.entity.common.FlowEntity; + +/** + * 警情推送实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@TableName("T_SCC_ALARM_PUSH") +@ApiModel(value = "SccAlarmPush对象", description = "警情推送") +public class SccAlarmPush extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 警情来源;1-设备报警,2-人员报警 + */ + @ApiModelProperty(value = "警情来源;2-设备报警,1-人员报警") + @TableField("ALARM_TYPE") + private String alarmType; + /** + * 警情推送时间 + */ + @ApiModelProperty(value = "警情推送时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:SS") + @TableField("ALARM_TIME") + private Date alarmTime; + /** + * 事件描述 + */ + @ApiModelProperty(value = "事件描述") + @TableField("EVENT_DESCRIPTION") + private String eventDescription; + /** + * 接收机构 + */ + @ApiModelProperty(value = "接收机构") + @TableField("RECEIVE_DEPT") + private String receiveDept; + /** + * 逻辑删除标识符;;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + /** + *警情推送状态(0-待推送,1-已推送) + */ + @ApiModelProperty(value = "警情推送状态(0-待推送,1-已推送,2-以提报)") + @TableField("PUSH_STATE") + private String pushState; + + /** + * 联系接警记录关联id + */ + @ApiModelProperty(value = "联系接警记录关联id") + @TableField("LINK_ID") + private String linkId; + + /** + * 网点代码级联字符串,用于级联选择框展示 + */ + @ApiModelProperty(value = "网点代码级联字符串,用于级联选择框展示") + @TableField("RECEIVE_DEPT_FRONT") + private String receiveDeptFront; + + /** + * 接收机构接收警情的相关角色 + */ + @ApiModelProperty(value = "接收机构接收警情的相关角色") + @TableField("DEPT_ROLES") + private String deptRoles; + + /** + * 处理情况 + */ + @ApiModelProperty(value = "处理情况") + @TableField("TREATMENT") + private String treatment; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARK") + private String remark; + + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + + /** + * 状态;0-未提报 1-按时提报 2-超时提报 3-超时未报 + */ + @ApiModelProperty(value = "状态;0-未提报 1-按时提报 2-超时提报 3-超时未报") + @TableField("STATUS") + private String status; + + /** + * 相关附件groupName标识 + */ + @ApiModelProperty(value = "相关附件groupName标识") + @TableField("GROUP_NAME") + private String groupName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccAnswerAlarm.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccAnswerAlarm.java new file mode 100644 index 0000000..4ba4ef7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccAnswerAlarm.java @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; +import org.security.ht.entity.common.FlowEntity; + +/** + * 安保指挥中心-联系接警记录实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@TableName("T_SCC_ANSWER_ALARM") +@ApiModel(value = "SccAnswerAlarm对象", description = "安保指挥中心-联系接警记录") +public class SccAnswerAlarm extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 对方联系人 + */ + @ApiModelProperty(value = "对方联系人") + @TableField("OPPOSITE_CONTACT") + private String oppositeContact; + /** + * 记录人 + */ + @ApiModelProperty(value = "记录人") + @TableField("RECORDER") + private String recorder; + /** + * 联系人电话 + */ + @ApiModelProperty(value = "联系人电话") + @TableField("CONTACTS_TEL") + private String contactsTel; + /** + * 类型;1-接警记录、2-通话记录、3-其他 + */ + @ApiModelProperty(value = "类型;1-接警记录、2-通话记录、3-其他") + @TableField("TYPE") + private String type; + + /** + * 数据状态(0-未推送,1-已推送,2-已办结) + */ + @ApiModelProperty(value = "数据状态(0-未推送,1-已推送,2-已办结)") + @TableField("PUSH_STATE") + private String pushState; + + /** + * 报警类型(1-外侵事件,2-设备问题) + */ + @ApiModelProperty(value = "报警类型(1-外侵事件,2-设备问题)") + @TableField("ALARM_TYPE") + private String alarmType; + + /** + * 处理结果 + */ + @ApiModelProperty(value = "处理结果") + @TableField("HANDLE_RESULTS") + private String handleResults; + + /** + * 联系单位 + */ + @ApiModelProperty(value = "联系单位") + @TableField("CONTACTS_COMPANY") + private String contactsCompany; + /** + * 地点 + */ + @ApiModelProperty(value = "地点") + @TableField("PLACE") + private String place; + /** + * 通话内容 + */ + @ApiModelProperty(value = "通话内容") + @TableField("CALL_CONTENT") + private String callContent; + /** + * 处理情况 + */ + @ApiModelProperty(value = "处理情况") + @TableField("TREATMENT") + private String treatment; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARK") + private String remark; + /** + * 记录时间 + */ + @ApiModelProperty(value = "记录时间") + @TableField("ALARM_TIME") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date alarmTime; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + + /** + * 网点代码级联字符串,用于级联选择框展示 + */ + @ApiModelProperty(value = "网点代码级联字符串,用于级联选择框展示") + @TableField("PLACE_CODE_FRONT") + private String placeCodeFront; + + /** + * 相关附件groupName标识 + */ + @ApiModelProperty(value = "相关附件groupName标识") + @TableField("GROUP_NAME") + private String groupName; + + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @TableField("dept_name") + private String deptName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccCheck.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccCheck.java new file mode 100644 index 0000000..2d56a15 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccCheck.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; +import org.security.ht.entity.common.FlowEntity; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 安保指挥长中心-营业网点检查和自主银行检查记录实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@TableName("T_SCC_CHECK") +@ApiModel(value = "SccCheck对象", description = "安保指挥长中心-营业网点检查和自主银行检查记录") +public class SccCheck extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + + /** + * 检查类型;1-营业网点检查、2-自助银行检查 + */ + @ApiModelProperty(value = "检查类型;1-营业网点检查、2-自助银行检查") + @TableField("CHECK_TYPE") + private String checkType; + /** + * 值班人员 + */ + @ApiModelProperty(value = "值班人员") + @TableField("PERSON_ON_DUTY") + private String personOnDuty; + /** + * 值班时间 + */ + @ApiModelProperty(value = "值班时间") + @TableField("DUTY_TIME") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GTM + 8") + private Date dutyTime; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @TableField("dept_name") + private String deptName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccCheckLines.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccCheckLines.java new file mode 100644 index 0000000..c6d225d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccCheckLines.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 安保指挥中心-营业网点检查和自助银行检查记录明细实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@TableName("T_SCC_CHECK_LINES") +@ApiModel(value = "SccCheckLines对象", description = "安保指挥中心-营业网点检查和自助银行检查记录明细") +public class SccCheckLines extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 主表记录id + */ + @ApiModelProperty(value = "主表记录id") + @TableField("FORM_ID") + private String formId; + /** + * 网点代码级联字符串,用于级联选择框展示 + */ + @ApiModelProperty(value = "网点代码串") + @TableField("OUTLETS_CODE_FRONT") + private String outletsCodeFront; + /** + * 网点代码 + */ + @ApiModelProperty(value = "网点代码") + @TableField("OUTLETS_CODE") + private String outletsCode; + /** + * 网点名称 + */ + @ApiModelProperty(value = "网点名称") + @TableField("OUTLETS_NAME") + private String outletsName; + /** + * 安防设施设备运行情况/自助机具及安防设施设备运行情况;0-异常,1-正常 + */ + @ApiModelProperty(value = "安防设施设备运行情况/自助机具及安防设施设备运行情况;0-异常,1-正常,2-已整改") + @TableField("CHECK_STATUS") + private String checkStatus; + + /** + * 检查时间 + */ + @ApiModelProperty(value = "检查时间") + @TableField("CHECK_TIME") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:SS") + private Date checkTime; + /** + * 异常情况说明 + */ + @ApiModelProperty(value = "异常情况说明") + @TableField("ABNORMAL_CONDITIONS") + private String abnormalConditions; + /** + * 处理措施 + */ + @ApiModelProperty(value = "处理措施") + @TableField("DEAL_WITH_MEASURES") + private String dealWithMeasures; + /** + * 处理结果 + */ + @ApiModelProperty(value = "处理结果") + @TableField("DEAL_WITH_RESULT") + private String dealWithResult; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARK") + private String remark; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccMsgSend.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccMsgSend.java new file mode 100644 index 0000000..c1719f8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccMsgSend.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 安保指挥中心-警情推送记录实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@TableName("T_SCC_MSG_SEND") +@ApiModel(value = "SccMsgSend对象", description = "安保指挥中心-警情推送记录") +public class SccMsgSend extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 联系接警记录关联id + */ + @ApiModelProperty(value = "联系接警记录关联id") + @TableField("FORM_ID") + private String formId; + /** + * 消息发送机构 + */ + @ApiModelProperty(value = "消息发送机构") + @TableField("MESSAGE_SENDING_DEPT") + private String messageSendingDept; + /** + * 消息接收机构 + */ + @ApiModelProperty(value = "消息接收机构") + @TableField("MESSAGES_RECEIVING_DEPT") + private String messagesReceivingDept; + /** + * 消息接收人 + */ + @ApiModelProperty(value = "消息接收人") + @TableField("MESSAGES_RECEIVING_MAN") + private String messagesReceivingMan; + /** + * 消息接收电话 + */ + @ApiModelProperty(value = "消息接收电话") + @TableField("MESSAGES_RECEIVING_TEL") + private String messagesReceivingTel; + /** + * 消息内容 + */ + @ApiModelProperty(value = "消息内容") + @TableField("MESSAGE_CONTENT") + private String messageContent; + /** + * 消息发送状态;0-发送失败、1-发送成功 + */ + @ApiModelProperty(value = "消息发送状态;0-发送失败、1-发送成功") + @TableField("STATE") + private String state; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccUnlocaleCheck.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccUnlocaleCheck.java new file mode 100644 index 0000000..8d9c58c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccUnlocaleCheck.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; +import org.security.ht.entity.common.FlowEntity; + +/** + * 安保指挥中心-非现场检查整改通知书实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@TableName("T_SCC_UNLOCALE_CHECK") +@ApiModel(value = "SccUnlocaleCheck对象", description = "安保指挥中心-非现场检查整改通知书") +public class SccUnlocaleCheck extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 文号 + */ + @ApiModelProperty(value = "文号") + @TableField("DOCUMENT_NO") + private String documentNo; + /** + * 检查单位 + */ + @ApiModelProperty(value = "检查单位") + @TableField("INSPECT_DEPT") + private String inspectDept; + /** + * 检查人 + */ + @ApiModelProperty(value = "检查人") + @TableField("INSPECT_STAFF") + private String inspectStaff; + /** + * 被检查单位 + */ + @ApiModelProperty(value = "被检查单位") + @TableField("INSPECTED_DEPT") + private String inspectedDept; + /** + * 整改责任人 + */ + @ApiModelProperty(value = "整改责任人") + @TableField("RECTIFICATION_RESPONSIBLE_PERSON") + private String rectificationResponsiblePerson; + /** + * 整改期限 + */ + @ApiModelProperty(value = "整改期限") + @TableField("RECTIFICATION_DEADLINE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectificationDeadline; + /** + * 状态;0-待下发,1-待整改,2-按时整改,3-超时整改,4-超时未整改,5-持续整改,6-安全员确认 + */ + @ApiModelProperty(value = "状态;0-待下发,1-待整改,2-按时整改,3-超时整改,4-超时未整改,5-持续整改,6-安全员确认") + @TableField("STATUS") + private String status; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + /** + * 整改通知书类型(1-自助银行检查整改通知书,2-营业网点检查整改通知书,3-其他检查整改通知书) + */ + @ApiModelProperty(value = "整改通知书类型(1-营业网点检查整改通知书,2-自助银行检查整改通知书,3-其他检查整改通知书)") + @TableField("NOTICE_TYPE") + private String noticeType; + + /** + * 关联营业网点检查和自助银行检查id(即非现场检查日志明细行) + */ + @ApiModelProperty(value = "关联营业网点检查和自助银行检查id") + @TableField("LINK_ID") + private String linkId; + + /** + * 关联非现场检查日志id + */ + @ApiModelProperty(value = "关联非现场检查日志id") + @TableField("LINK_FORM_ID") + private String linkFormId; + + + /** + * 检查单位代码串;用于前端级联框回显 + */ + @ApiModelProperty(value = "检查单位代码串;用于前端级联框回显") + @TableField("INSPECT_DEPT_FRONT") + private String inspectDeptFront; + + /** + * 被检查单位代码串;用于前端级联框回显 + */ + @ApiModelProperty(value = "被检查单位代码串;用于前端级联框回显") + @TableField("INSPECTED_DEPT_FRONT") + private String inspectedDeptFront; + + /** + * 相关附件groupName标识 + */ + @ApiModelProperty(value = "相关附件groupName标识") + @TableField("GROUP_NAME") + private String groupName; + + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称") + @TableField("dept_name") + private String deptName; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccUnlocaleCheckLine.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccUnlocaleCheckLine.java new file mode 100644 index 0000000..c04a04e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/entity/SccUnlocaleCheckLine.java @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; +import org.security.ht.entity.common.FlowEntity; + +/** + * 安保指挥中心-非现场检查整改明细实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@TableName("T_SCC_UNLOCALE_CHECK_LINE") +@ApiModel(value = "SccUnlocaleCheckLine对象", description = "安保指挥中心-非现场检查整改明细") +public class SccUnlocaleCheckLine extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 非现场检查整改记录id + */ + @ApiModelProperty(value = "非现场检查整改记录id") + @TableField("FORM_ID") + private String formId; + /** + * 网点代码 + */ + @ApiModelProperty(value = "网点代码") + @TableField("OUTLETS_CODE") + private String outletsCode; + /** + * 网点名称 + */ + @ApiModelProperty(value = "网点名称") + @TableField("OUTLETS_NAME") + private String outletsName; + /** + * 问题发现时间 + */ + @ApiModelProperty(value = "问题发现时间") + @TableField("DISCOVER_PROBLEMS_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date discoverProblemsTime; + /** + * 问题描述 + */ + @ApiModelProperty(value = "问题描述") + @TableField("PROBLEMS_DESCRIBE") + private String problemsDescribe; + /** + * 整改措施 + */ + @ApiModelProperty(value = "整改措施") + @TableField("RECTIFICATION_MEASURES") + private String rectificationMeasures; + /** + * 整改结果 + */ + @ApiModelProperty(value = "整改结果") + @TableField("RECTIFICATION_RESULT") + private String rectificationResult; + /** + * 整改完成时间 + */ + @ApiModelProperty(value = "整改完成时间") + @TableField("RECTIFICATION_END_TIME") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectificationEndTime; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @TableField("REMARK") + private String remark; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + /** + * 网点代码级联字符串,用于级联选择框展示 + */ + @ApiModelProperty(value = "网点代码串") + @TableField("OUTLETS_CODE_FRONT") + private String outletsCodeFront; + + + /** + * 相关附件groupName标识 + */ + @ApiModelProperty(value = "相关附件groupName标识") + @TableField("GROUP_NAME") + private String groupName; + + /** + * 类型标识 1-普通一次性整改记录 2-持续整改后续补充整改记录 + */ + @ApiModelProperty(value = "类型标识 1-普通一次性整改记录 2-持续整改后续补充整改记录") + @TableField("rec_flag") + private String recFlag; + + /** + * 是否需持续整改 1-否 2-是 + */ + @ApiModelProperty(value = "是否需持续整改 1-否 2-是") + @TableField("record_flag") + private String recordFlag; + + /** + * 持续整改的整改期限 + */ + @ApiModelProperty(value = "持续整改的整改期限") + @TableField("rectification_deadline") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectificationDeadline; + + /** + * 明细记录整改状态(1-待整改,2-按时整改,3-超时整改,4-超时未整改,6-持续整改待确认) + */ + @ApiModelProperty(value = "明细记录整改状态(1-待整改,2-按时整改,3-超时整改,4-超时未整改,6-持续整改待确认)") + @TableField("status") + private String status; + + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAlarmPushMapper.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAlarmPushMapper.java new file mode 100644 index 0000000..d9836f9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAlarmPushMapper.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.securityCommandCenter.dto.SccAlarmPushDTO; +import org.security.trans.securityCommandCenter.entity.SccAlarmPush; +import org.security.trans.securityCommandCenter.vo.SccAlarmPushVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 警情推送 Mapper 接口 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface SccAlarmPushMapper extends BaseMapper { + + /** + * 推送警情列表数据 + * + * @param page + * @param sccAlarmPushDTO + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectSccAlarmPushPage(IPage page, @Param("sccAlarmPush") SccAlarmPushDTO sccAlarmPushDTO); + + /** + * 获取警情接收页面列表数据 + * @param page + * @param sccAlarmPushDTO + * @param roleIdList + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "RECEIVE_DEPT") + List selectSccAlarmPushDetailPage(IPage page, @Param("sccAlarmPush")SccAlarmPushDTO sccAlarmPushDTO, @Param("roleIdList") List roleIdList); + + /** + * 获取接收消息的角色 + * @param receiveDeptId + * @return + */ + List getDutyPerson(@Param("receiveDeptId") String receiveDeptId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAlarmPushMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAlarmPushMapper.xml new file mode 100644 index 0000000..60c1e74 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAlarmPushMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAnswerAlarmMapper.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAnswerAlarmMapper.java new file mode 100644 index 0000000..7ebddb8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAnswerAlarmMapper.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.dataStatistics.dto.AnswerAlarmDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.AnswerAlarmDataVO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.security.trans.securityCommandCenter.dto.SccAnswerAlarmDTO; +import org.security.trans.securityCommandCenter.entity.SccAnswerAlarm; +import org.security.trans.securityCommandCenter.vo.SccAnswerAlarmVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 安保指挥中心-联系接警记录 Mapper 接口 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface SccAnswerAlarmMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param sccAnswerAlarmDTO + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectSccAnswerAlarmPage(IPage page,@Param("sccAnswerAlarmDTO") SccAnswerAlarmDTO sccAnswerAlarmDTO); + + /** + *获取数据统计列表数据 + */ + List getAimStatisticsData(@Param("answerAlarmDataDTO") AnswerAlarmDataDTO answerAlarmDataDTO, @Param("aimDepts") List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAnswerAlarmMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAnswerAlarmMapper.xml new file mode 100644 index 0000000..fa00a02 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccAnswerAlarmMapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckLinesMapper.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckLinesMapper.java new file mode 100644 index 0000000..7070dfa --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckLinesMapper.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.securityCommandCenter.dto.SccCheckLinesDTO; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import org.security.trans.securityCommandCenter.vo.SccCheckLinesVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 安保指挥中心-营业网点检查和自助银行检查记录明细 Mapper 接口 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface SccCheckLinesMapper extends BaseMapper { + + + /** + * 自定义分页 获取检查异常的日志记录 + * @param page 自定义分页参数 + * @param sccCheckLinesDTO 查询条件 + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "OUTLETS_CODE") + List selectDetailPage(IPage page,@Param("sccCheckLinesDTO") SccCheckLinesDTO sccCheckLinesDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckLinesMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckLinesMapper.xml new file mode 100644 index 0000000..d23d01c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckLinesMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckMapper.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckMapper.java new file mode 100644 index 0000000..ad28bd2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckMapper.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.dto.UnlocaleCheckDataDTO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.security.trans.securityCommandCenter.dto.SccCheckDTO; +import org.security.trans.securityCommandCenter.entity.SccCheck; +import org.security.trans.securityCommandCenter.vo.SccCheckVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 安保指挥长中心-营业网点检查和自主银行检查记录 Mapper 接口 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface SccCheckMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param sccCheckDTO + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectSccCheckPage(IPage page, @Param("sccCheck") SccCheckDTO sccCheckDTO); + + /** + * 数据统计-获取统计数据 + */ + List getAimStatisticsData(@Param("unlocaleCheckDataDTO") UnlocaleCheckDataDTO unlocaleCheckDataDTO, @Param("aimDepts") List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckMapper.xml new file mode 100644 index 0000000..22fb645 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccCheckMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccMsgSendMapper.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccMsgSendMapper.java new file mode 100644 index 0000000..ae77feb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccMsgSendMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.mapper; + +import org.security.trans.securityCommandCenter.entity.SccMsgSend; +import org.security.trans.securityCommandCenter.vo.SccMsgSendVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 安保指挥中心-警情推送记录 Mapper 接口 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface SccMsgSendMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param sccMsgSend + * @return + */ + List selectSccMsgSendPage(IPage page, SccMsgSendVO sccMsgSend); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccMsgSendMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccMsgSendMapper.xml new file mode 100644 index 0000000..824a79c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccMsgSendMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckLineMapper.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckLineMapper.java new file mode 100644 index 0000000..bb81019 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckLineMapper.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.securityCommandCenter.dto.ContinuedRecDataDTO; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import org.security.trans.securityCommandCenter.vo.ContinuedRecDataVO; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckLineVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 安保指挥中心-非现场检查整改明细 Mapper 接口 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface SccUnlocaleCheckLineMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param sccUnlocaleCheckLine + * @return + */ + List selectSccUnlocaleCheckLinePage(IPage page, SccUnlocaleCheckLineVO sccUnlocaleCheckLine); + + /** + *获取持续整改记录 + * @param page + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List getContinuedPage(IPage page, @Param("continuedRecDataDTO") ContinuedRecDataDTO continuedRecDataDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckLineMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckLineMapper.xml new file mode 100644 index 0000000..7afa14e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckLineMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckMapper.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckMapper.java new file mode 100644 index 0000000..b2a7e8b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckMapper.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.RectificationNoticeDataVO; +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckDTO; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 安保指挥中心-非现场检查整改通知书 Mapper 接口 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface SccUnlocaleCheckMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param sccUnlocaleCheckDTO 查询条件 + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectGiveUpData(IPage page,@Param("sccUnlocaleCheckDTO") SccUnlocaleCheckDTO sccUnlocaleCheckDTO); + + /** + * + * @param page 分页参数 + * @param sccUnlocaleCheckDTO 查询条件 + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "INSPECTED_DEPT") + List selectHandInData(IPage page,@Param("sccUnlocaleCheckDTO") SccUnlocaleCheckDTO sccUnlocaleCheckDTO); + + /** + * 获取用户名称 + * @param rectifyUser 用户id + * @return + */ + String getUserName(@Param("rectifyUser") String rectifyUser); + + /** + * 根据机构号获取责任整改人 + * @param outletsCode 机构号 + * @param roleName + * @return + */ + List getDutyPerson(@Param("outletsCode") String outletsCode , @Param("roleName")String roleName); + + /** + * 数据统计-列表数据获取 + */ + List getStatisticsData(StatisticsDataDTO statisticsDataDTO, List aimDepts); + + /** + * 获取自助银行检查-自助银行的直属营业机构的机构id + */ + String getDeptId(@Param("outletsCode") String outletsCode); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckMapper.xml new file mode 100644 index 0000000..1cd6170 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/mapper/SccUnlocaleCheckMapper.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccAlarmPushService.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccAlarmPushService.java new file mode 100644 index 0000000..6d9bfb7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccAlarmPushService.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service; + +import org.security.trans.common.service.FlowableService; +import org.security.trans.securityCommandCenter.dto.SccAlarmPushDTO; +import org.security.trans.securityCommandCenter.entity.SccAlarmPush; +import org.security.trans.securityCommandCenter.entity.SccAnswerAlarm; +import org.security.trans.securityCommandCenter.vo.SccAlarmPushVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * 警情推送 服务类 + * + * @author BladeX + * @since 2022-07-13 + */ +public interface ISccAlarmPushService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param sccAlarmPushDTO + * @return + */ + IPage selectSccAlarmPushPage(IPage page, SccAlarmPushDTO sccAlarmPushDTO); + + /** + * 获取警情推送详情 + * @param id + * @return + */ + SccAlarmPushVO getData(String id); + + /** + * 警情推送信息入库 + * @param sccAlarmPushDTO 警情信息 + * @return + */ + boolean saveData(SccAlarmPushDTO sccAlarmPushDTO); + + /** + * 联系接警记录为接警记录-发起警情推送 + * @param sccAnswerAlarm + * @return + */ + boolean senAlarmNotice(SccAnswerAlarm sccAnswerAlarm); + + /** + * 移除警情推送记录信息 + * @param toStrList + * @return + */ + boolean removeData(List toStrList); + + /** + * 警情推送提报暂存 + * @param sccAlarmPushDTO + * @return + */ + boolean updateData(SccAlarmPushDTO sccAlarmPushDTO); + + /** + *定时任务获取未提报状态的警情信息 + */ + List getListData(String status); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccAnswerAlarmService.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccAnswerAlarmService.java new file mode 100644 index 0000000..9e71c0b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccAnswerAlarmService.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service; + +import org.security.trans.common.service.FlowableService; +import org.security.trans.dataStatistics.dto.AnswerAlarmDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.AnswerAlarmDataVO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.security.trans.securityCommandCenter.dto.SccAlarmPushDTO; +import org.security.trans.securityCommandCenter.dto.SccAnswerAlarmDTO; +import org.security.trans.securityCommandCenter.entity.SccAnswerAlarm; +import org.security.trans.securityCommandCenter.vo.SccAnswerAlarmVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.tool.api.R; + +import java.util.List; + +/** + * 安保指挥中心-联系接警记录 服务类 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface ISccAnswerAlarmService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param sccAnswerAlarmDTO + * @return + */ + IPage selectSccAnswerAlarmPage(IPage page, SccAnswerAlarmDTO sccAnswerAlarmDTO); + + /** + * 获取联系接警记录详情 + * @param id 记录id + * @return + */ + SccAnswerAlarmVO getData(String id); + + /** + * 联系接警记录入库 + * @param sccAnswerAlarmDTO 联系接警记录 + * @return + */ + boolean saveData(SccAnswerAlarmDTO sccAnswerAlarmDTO); + + /** + * 删除记录 + * @param toLongList id + * @return + */ + boolean removeData(List toLongList); + + /** + * 警情信息提报 + * @param sccAlarmPushDTO 警情信息 + * @return + */ + R handIn(SccAlarmPushDTO sccAlarmPushDTO); + + /** + * 获取数据统计列表数据 + * @return + */ + List getAimStatisticsData(AnswerAlarmDataDTO answerAlarmDataDTO, List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccCheckLinesService.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccCheckLinesService.java new file mode 100644 index 0000000..504c8fd --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccCheckLinesService.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service; + +import org.security.trans.securityCommandCenter.dto.SccCheckLinesDTO; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import org.security.trans.securityCommandCenter.vo.SccCheckLinesVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * 安保指挥中心-营业网点检查和自助银行检查记录明细 服务类 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface ISccCheckLinesService extends IService { + + + /** + * 获取检查异常记录项详情 + * @param id 记录id + * @return + */ + SccCheckLinesVO getData(String id); + + /** + * 营业网点对检查异常的记录进行整改结果提报 + * @param sccCheckLinesDTO 提报信息 + * @return + */ + boolean updateData(SccCheckLinesDTO sccCheckLinesDTO); + + /** + * 自定义分页 获取检查异常的日志记录 + * @param page 自定义分页参数 + * @param sccCheckLinesDTO 查询条件 + * @return + */ + List selectDetailPage(IPage page, SccCheckLinesDTO sccCheckLinesDTO); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccCheckService.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccCheckService.java new file mode 100644 index 0000000..34246d7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccCheckService.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service; + +import org.security.trans.common.service.FlowableService; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.dto.UnlocaleCheckDataDTO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.security.trans.securityCommandCenter.dto.SccCheckDTO; +import org.security.trans.securityCommandCenter.dto.SccCheckLinesDTO; +import org.security.trans.securityCommandCenter.entity.SccCheck; +import org.security.trans.securityCommandCenter.vo.SccCheckLinesVO; +import org.security.trans.securityCommandCenter.vo.SccCheckVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.text.ParseException; +import java.util.List; + +/** + * 安保指挥长中心-营业网点检查和自主银行检查记录 服务类 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface ISccCheckService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param sccCheckDTO + * @return + */ + IPage selectSccCheckPage(IPage page, SccCheckDTO sccCheckDTO); + + /** + * 获取营业网点检查日志或自助银行检查日志明细 + * @param id 记录id + * @return + */ + SccCheckVO getData(String id); + + + /** + * 安保指挥中心值班人员录入营业网点或自助银行的检查日志 + * @param sccCheckDTO 检查日志 + * @return + * @throws ParseException + */ + boolean saveCheckData(SccCheckDTO sccCheckDTO) throws ParseException; + + /** + * 删除检查日志记录 + * @param toLongList 删除目标数据的id + * @return + */ + boolean removeData(List toLongList); + + /** + * 审批通过后回调该接口创建整改通知书 + * @param id + * @return + */ + boolean createdCheackNotice(String id); + + /** + * 自定义分页 获取检查异常的日志记录 + * @param page 分页参数 + * @param sccCheckLinesDTO 查询条件 + * @return + */ + IPage selectDetailPage(IPage page, SccCheckLinesDTO sccCheckLinesDTO); + + /** + *数据统计-获取统计数据 + */ + List getAimStatisticsData(UnlocaleCheckDataDTO unlocaleCheckDataDTO, List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccMsgSendService.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccMsgSendService.java new file mode 100644 index 0000000..f9a817f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccMsgSendService.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service; + +import org.security.trans.securityCommandCenter.entity.SccMsgSend; +import org.security.trans.securityCommandCenter.vo.SccMsgSendVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 安保指挥中心-警情推送记录 服务类 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface ISccMsgSendService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param sccMsgSend + * @return + */ + IPage selectSccMsgSendPage(IPage page, SccMsgSendVO sccMsgSend); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccUnlocaleCheckLineService.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccUnlocaleCheckLineService.java new file mode 100644 index 0000000..120be90 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccUnlocaleCheckLineService.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service; + +import org.security.trans.common.service.FlowableService; +import org.security.trans.securityCommandCenter.dto.ContinuedRecDataDTO; +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckLineDTO; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import org.security.trans.securityCommandCenter.vo.ContinuedRecDataVO; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckLineVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.tool.api.R; + +import java.util.List; + +/** + * 安保指挥中心-非现场检查整改明细 服务类 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface ISccUnlocaleCheckLineService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param sccUnlocaleCheckLine + * @return + */ + IPage selectSccUnlocaleCheckLinePage(IPage page, SccUnlocaleCheckLineVO sccUnlocaleCheckLine); + + /** + * 获取持续整改记录 + * @param page + * @return + */ + List getContinuedPage(IPage page, ContinuedRecDataDTO continuedRecDataDTO); + + SccUnlocaleCheckLineVO getData(String id); + + boolean saveData(SccUnlocaleCheckLineDTO sccUnlocaleCheckLineDTO); + + R startProcess(SccUnlocaleCheckLine sccUnlocaleCheckLine, String deptId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccUnlocaleCheckService.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccUnlocaleCheckService.java new file mode 100644 index 0000000..8996721 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/ISccUnlocaleCheckService.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service; + +import org.security.trans.common.service.FlowableService; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.RectificationNoticeDataVO; +import org.security.trans.securityCommandCenter.dto.ContinuedRecDataDTO; +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckDTO; +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckLineDTO; +import org.security.trans.securityCommandCenter.entity.SccCheck; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import org.security.trans.securityCommandCenter.vo.ContinuedRecDataVO; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckLineVO; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.text.ParseException; +import java.util.List; + +/** + * 安保指挥中心-非现场检查整改通知书 服务类 + * + * @author BladeX + * @since 2022-07-06 + */ +public interface ISccUnlocaleCheckService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param sccUnlocaleCheckDTO + * @return + */ + IPage selectSccUnlocaleCheckPage(IPage page, SccUnlocaleCheckDTO sccUnlocaleCheckDTO); + + /** + * 下发非现场检查通知书 + * @param sccUnlocaleCheckDTO 非现场检查明细 + * @return + */ + boolean saveData(SccUnlocaleCheckDTO sccUnlocaleCheckDTO); + + /** + * 非现场检查整改结果暂存或提报 + * @param sccUnlocaleCheckDTO 整改结果明细 + * @return + */ + boolean handInData(SccUnlocaleCheckDTO sccUnlocaleCheckDTO) throws ParseException; + + /** + * 获取非现场检查整改明细信息 + * @param id id + * @return + */ + SccUnlocaleCheckVO getData(String id); + + /** + * 删除非现场检查整改通知书 + * @param toLongList 删除目标记录id的集合 + * @return + */ + boolean removeData(List toLongList); + + /** + * 营业网点检查或自助银行检查发现异常项,发起整改通知书 + * @param sccCheck 异常项 + * @param collect 异常项明细 + * @return + */ + boolean startRectedNotice(SccCheck sccCheck, List collect); + + /** + * 获取持续整改的整改记录 + * @param page 分页参数 + * @return + */ + IPage getContinuedPage(IPage page, ContinuedRecDataDTO continuedRecDataDTO); + + /** + * 获取持续整改记录详情 + * @param id + * @return + */ + SccUnlocaleCheckLineVO getContinuedDetail(String id); + + /** + * 提报持续整改记录结果 + * @param sccUnlocaleCheckLineDTO 持续整改明细 + * @return + */ + boolean handInContinuedRec(SccUnlocaleCheckLineDTO sccUnlocaleCheckLineDTO) throws ParseException; + + /** + * 定时任务获取待整改任务 + */ + List getListData(String status); + + /** + *数据统计-列表数据获取 + */ + List getStatisticsData(StatisticsDataDTO statisticsDataDTO, List aimDepts); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccAlarmPushServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccAlarmPushServiceImpl.java new file mode 100644 index 0000000..0a026c8 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccAlarmPushServiceImpl.java @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.desk.feign.IXYunClient; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.feign.ISysClient; +import org.security.system.user.vo.UserVO; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.securityCommandCenter.dto.SccAlarmPushDTO; +import org.security.trans.securityCommandCenter.entity.SccAlarmPush; +import org.security.trans.securityCommandCenter.entity.SccAnswerAlarm; +import org.security.trans.securityCommandCenter.entity.SccMsgSend; +import org.security.trans.securityCommandCenter.mapper.SccAnswerAlarmMapper; +import org.security.trans.securityCommandCenter.service.ISccAnswerAlarmService; +import org.security.trans.securityCommandCenter.service.ISccMsgSendService; +import org.security.trans.securityCommandCenter.vo.SccAlarmPushVO; +import org.security.trans.securityCommandCenter.mapper.SccAlarmPushMapper; +import org.security.trans.securityCommandCenter.service.ISccAlarmPushService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 警情推送 服务实现类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Slf4j +@Service +@AllArgsConstructor +public class SccAlarmPushServiceImpl extends ServiceImpl implements ISccAlarmPushService { + + private final IFileService fileService; + private final ISccMsgSendService sccMsgSendService; + private final IDepartmentService departmentService; + private final IFlowClient flowClient; + private final ISysClient sysClient; + private final SccAnswerAlarmMapper answerAlarmMapper; + private final IXYunClient xYunClient; + private final IInspectionService inspectionService; + + @Override + public IPage selectSccAlarmPushPage(IPage page, SccAlarmPushDTO sccAlarmPushDTO) { + List vos; + //推送警情菜单列表页数据获取 + if (Constant.MENU_TYPE_ZERO.equals(sccAlarmPushDTO.getMenuType())){ + log.info("==============获取推送警情菜单列表页数据开始=============="); + vos = baseMapper.selectSccAlarmPushPage(page, sccAlarmPushDTO); + if (Func.isNotEmpty(vos)){ + vos.forEach(item -> { + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + item.setButtonStatus(Constant.BUTTON_STATE_ZERO); + //若该警情信息已推送/已提报则该记录只能查看不能操作 + if (Constant.PUSH_STATE_ONE.equals(item.getPushState()) || Constant.PUSH_STATE_TWO.equals(item.getPushState())) { + item.setButtonStatus(Constant.BUTTON_STATE_THREE); + } + item.setReceiveDept(departmentService.getById(item.getReceiveDept()).getDeptName()); + }); + } + log.info("==============获取推送警情菜单列表页数据结束=============="); + }//警情接收菜单获取警情消息,只有指定角色能看到推送的警情信息(一个用户可能有多个角色) + else { + log.info("==============获取警情接收菜单获取警情消息开始=============="); + vos = baseMapper.selectSccAlarmPushDetailPage(page, sccAlarmPushDTO,Arrays.asList(AuthUtil.getUser().getRoleId().split(","))); + if (Func.isNotEmpty(vos)){ + vos.forEach(item -> { + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + item.setButtonStatus(Constant.BUTTON_STATE_THREE); + //待推送/被驳回/审批撤回且部门id为当前登录人部门的状态可以编辑 + if ((Constant.PUSH_STATE_ONE.equals(item.getPushState()) + || Constant.HANDIN_STATE_REFUSE.equals(item.getState()) + || ProcessConstant.CANCEL_STATE.equals(item.getState())) + && AuthUtil.getDeptId().equals(item.getReceiveDept())) { + item.setButtonStatus(Constant.BUTTON_STATE_ZERO); + } + item.setReceiveDept(departmentService.getById(item.getReceiveDept()).getDeptName()); + }); + } + log.info("==============获取警情接收菜单获取警情消息结束=============="); + } + List collect = vos.stream().sorted(Comparator.comparing(SccAlarmPushVO::getUpdatedTime,Comparator.nullsLast(Comparator.reverseOrder()))).collect(Collectors.toList()); + return page.setRecords(collect); + } + + @Override + public SccAlarmPushVO getData(String id) { + log.info("==============获取警情详情开始=============="); + SccAlarmPush sccAlarmPush = this.getById(id); + SccAlarmPushVO sccAlarmPushVO = Func.copy(sccAlarmPush, SccAlarmPushVO.class); + sccAlarmPushVO.setReceiveDeptName(Func.isNotEmpty(sccAlarmPush.getReceiveDept()) ? departmentService.getById(sccAlarmPush.getReceiveDept()).getDeptName() : null); + //获取相关附件 + List attachments= fileService.getAttachments(sccAlarmPush.getId(),sccAlarmPush.getGroupName()); + sccAlarmPushVO.setRelevantAttachments(attachments); + log.info("==============获取警情详情结束=============="); + return sccAlarmPushVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveData(SccAlarmPushDTO sccAlarmPushDTO) { + log.info("==============警情信息编辑/推送开始=============="); + SccAlarmPush alarmPush = Func.copy(sccAlarmPushDTO, SccAlarmPush.class); + alarmPush.setDeptId(AuthUtil.getDeptId()); + alarmPush.setPushState(sccAlarmPushDTO.getSubmitType()); + alarmPush.setStatus(Constant.PUSH_STATUS_ZERO); + if (Func.isEmpty(sccAlarmPushDTO.getDeptRoles())){ + setReceiveRoles(sccAlarmPushDTO.getReceiveDept(),alarmPush); + } + //将警情信息增值推送和编辑分开 + boolean b; + if (Func.isNotEmpty(sccAlarmPushDTO.getId())){ + b = this.update(alarmPush,new UpdateWrapper().lambda().eq(SccAlarmPush::getId,sccAlarmPushDTO.getId()).eq(SccAlarmPush::getPushState,Constant.PUSH_STATE_ZERO)); + }else { + b = this.save(alarmPush); + } + //保存相关附件 + if (b) { + fileService.saveAttachments(sccAlarmPushDTO.getRelevantAttachments(),alarmPush.getId()); + } + //如果页面操作为推送警情,则调用信息发送接口 + boolean result = true; + if (Constant.SUBMIT_TYPE_ONE.equals(sccAlarmPushDTO.getSubmitType()) && "0".equals(sccAlarmPushDTO.getMenuType())){ + //result = startProcess(alarmPush); + sendAlarmMsg(alarmPush); + } + log.info("==============警情信息编辑/推送结束=============="); + return result; + } + + /** + *发送警情信息的香云通知 + */ + private void sendAlarmMsg(SccAlarmPush alarmPush) { + log.info("==============发送警情信息的香云通知开始=============="); + //获取消息通知人员工号 + List userCodes = getNoticeUserCode(alarmPush); + String msg = "您有一条["+ alarmPush.getAlarmTime() +"]时间推送,事件描述为[" + alarmPush.getEventDescription() + "]的警情信息待处理!"; + xYunClient.sendMessageToXYun(Func.join(userCodes,","),msg); + log.info("==============发送警情信息的香云通知结束=============="); + } + + /** + * 获取消息通知人员工号 + */ + private List getNoticeUserCode(SccAlarmPush alarmPush) { + List userCodes = new ArrayList<>(); + //获取消息通知人员工号 + List list = Arrays.asList(alarmPush.getDeptRoles().split(",")); + if (Func.isNotEmpty(list)){ + list.forEach(roleId ->{ + List user = inspectionService.getUserByRoleId(roleId, alarmPush.getReceiveDept()); + if (Func.isNotEmpty(user)){ + user.forEach(item->{ + userCodes.add(item.getCode()); + }); + } + }); + } + return userCodes; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean senAlarmNotice(SccAnswerAlarm sccAnswerAlarm) { + SccAlarmPush alarmPush = setSccAlarmPush(sccAnswerAlarm); + //获取联系接警记录附件 + List attachments = fileService.getAttachments(sccAnswerAlarm.getId(), sccAnswerAlarm.getGroupName()); + this.save(alarmPush); + //将附件保存至警情信息记录下 + if (Func.isNotEmpty(attachments)){ + attachments.forEach(item -> { + item.setGroupName("aralmPushAttachments"); + item.setId(null); + }); + } + fileService.saveAttachments(attachments,alarmPush.getId()); + //发送警情信息香云通知 + sendAlarmMsg(alarmPush); + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean removeData(List toStrList) { + return this.removeByIds(toStrList) && fileService.removeFileData(toStrList); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateData(SccAlarmPushDTO sccAlarmPushDTO) { + SccAlarmPush alarmPush = Func.copy(sccAlarmPushDTO, SccAlarmPush.class); + //将警情信暂存 + this.updateById(alarmPush); + //保存相关附件 + fileService.saveAttachments(sccAlarmPushDTO.getRelevantAttachments(),alarmPush.getId()); + return true; + } + + @Override + public List getListData(String status) { + return this.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(status),SccAlarmPush::getStatus,status) + .eq(SccAlarmPush::getDelFlag,Constant.DELETE_FLAG_0)); + } + + public boolean startProcess(SccAlarmPush alarmPush) { + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.SCC_ALARM_PUSH_KEY); + if (definitionRes.isSuccess()) { + alarmPush.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + Integer sendDeptCategory; + if (!Func.isNull(alarmPush) && !Func.isNull(alarmPush.getLinkId()) && !Func.isEmpty(alarmPush.getLinkId())) { + SccAnswerAlarm sccAnswerAlarm = answerAlarmMapper.selectById(alarmPush.getLinkId()); + if (Func.isNull(sccAnswerAlarm) || Func.isNull(sccAnswerAlarm.getDeptId()) || Func.isEmpty(sccAnswerAlarm.getDeptId())) { + throw new ServiceException("推送部门为空,请检查后再试!"); + } + R sendDeptCategoryRes = sysClient.getDeptCategory(Long.valueOf(sccAnswerAlarm.getDeptId())); + if (!sendDeptCategoryRes.isSuccess()) { + throw new ServiceException("查询推送部门类型失败,请检查后再试!"); + } + sendDeptCategory = sendDeptCategoryRes.getData(); + } else { + sendDeptCategory = deptCategory.getData(); + } + Kv variables = Kv.create() + .set(ProcessConstant.BUSINESS_ID_KEY, alarmPush.getId()) + .set("deptCategory", deptCategory.getData()) + .set("sendDeptCategory", sendDeptCategory) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + String businessTable = FlowUtil.getBusinessTable(SccAlarmPush.class); + R result = flowClient.startProcessInstanceById(alarmPush.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(alarmPush.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + alarmPush.setProcessInstanceId(result.getData().getProcessInstanceId()); + } else { + throw new ServiceException("开启流程失败"); + } + this.saveOrUpdate(alarmPush); + return true; + } + + /** + *封装警情推送信息 + */ + private SccAlarmPush setSccAlarmPush(SccAnswerAlarm sccAnswerAlarm) { + SccAlarmPush alarmPush = new SccAlarmPush(); + alarmPush.setLinkId(sccAnswerAlarm.getId()); + alarmPush.setAlarmType(sccAnswerAlarm.getAlarmType()); + alarmPush.setAlarmTime(sccAnswerAlarm.getAlarmTime()); + alarmPush.setEventDescription(sccAnswerAlarm.getCallContent()); + alarmPush.setReceiveDept(sccAnswerAlarm.getPlace()); + alarmPush.setPushState(Constant.PUSH_STATE_ONE); + alarmPush.setStatus(Constant.PUSH_STATUS_ZERO); + alarmPush.setReceiveDeptFront(sccAnswerAlarm.getPlaceCodeFront()); + String receiveDeptId = sccAnswerAlarm.getPlace(); + setReceiveRoles(receiveDeptId, alarmPush); + alarmPush.setDeptId(AuthUtil.getDeptId()); + return alarmPush; + } + + /** + *设置警情接收相关角色 + */ + private void setReceiveRoles(String receiveDeptId, SccAlarmPush alarmPush) { + log.info("==============获取警情接收相关角色开始=============="); + List dutyPerson = baseMapper.getDutyPerson(receiveDeptId); + alarmPush.setDeptRoles(Func.isNotEmpty(dutyPerson) ? Func.join(dutyPerson,","): ""); + log.info("==============获取警情接收相关角色结束=============="); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccAnswerAlarmServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccAnswerAlarmServiceImpl.java new file mode 100644 index 0000000..e71b871 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccAnswerAlarmServiceImpl.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service.impl; + +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.feign.ISysClient; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.dataStatistics.dto.AnswerAlarmDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.AnswerAlarmDataVO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.security.trans.securityCommandCenter.dto.SccAlarmPushDTO; +import org.security.trans.securityCommandCenter.dto.SccAnswerAlarmDTO; +import org.security.trans.securityCommandCenter.entity.SccAlarmPush; +import org.security.trans.securityCommandCenter.entity.SccAnswerAlarm; +import org.security.trans.securityCommandCenter.service.ISccAlarmPushService; +import org.security.trans.securityCommandCenter.vo.SccAnswerAlarmVO; +import org.security.trans.securityCommandCenter.mapper.SccAnswerAlarmMapper; +import org.security.trans.securityCommandCenter.service.ISccAnswerAlarmService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 安保指挥中心-联系接警记录 服务实现类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Slf4j +@Service +@AllArgsConstructor +public class SccAnswerAlarmServiceImpl extends ServiceImpl implements ISccAnswerAlarmService { + private final IFileService fileService; + private final ISccAlarmPushService sccAlarmPushService; + private final IFlowClient flowClient; + private final IDepartmentService departmentService; + private final ISysClient sysClient; + private final IInspectionService iInspectionService; + + @Override + public IPage selectSccAnswerAlarmPage(IPage page, SccAnswerAlarmDTO sccAnswerAlarmDTO) { + log.info("==============获取联系接警记录开始=============="); + List vos = baseMapper.selectSccAnswerAlarmPage(page, sccAnswerAlarmDTO); + if (Func.isNotEmpty(vos)) { + vos.forEach(item ->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + item.setPlaceName(Func.isNotEmpty(item.getPlace()) ? departmentService.getById(item.getPlace()).getDeptName() : null); + }); + List collect = vos.stream().sorted(Comparator.comparing(SccAnswerAlarmVO::getUpdatedTime, Comparator.nullsLast(Comparator.reverseOrder()))).collect(Collectors.toList()); + return page.setRecords(collect); + } + log.info("==============获取联系接警记录结束=============="); + return page.setRecords(vos); + } + + @Override + public SccAnswerAlarmVO getData(String id) { + log.info("==============获取联系接警记详情录开始=============="); + SccAnswerAlarm sccAnswerAlarm = this.getById(id); + SccAnswerAlarmVO sccAnswerAlarmVO = Func.copy(sccAnswerAlarm, SccAnswerAlarmVO.class); + sccAnswerAlarmVO.setPlaceName(Func.isNotEmpty(sccAnswerAlarm.getPlace()) ? departmentService.getById(sccAnswerAlarm.getPlace()).getDeptName() : null); + //获取相关附件 + List attachments = fileService.getAttachments(id, sccAnswerAlarm.getGroupName()); + sccAnswerAlarmVO.setRelevantAttachments(attachments); + log.info("==============获取联系接警记详情录结束=============="); + return sccAnswerAlarmVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveData(SccAnswerAlarmDTO sccAnswerAlarmDTO) { + log.info("==============新增/编辑联系接警记详情录开始=============="); + //联系记录保存 + SccAnswerAlarm sccAnswerAlarm = Func.copy(sccAnswerAlarmDTO, SccAnswerAlarm.class); + sccAnswerAlarm.setDeptId(AuthUtil.getDeptId()); + sccAnswerAlarm.setDeptName(iInspectionService.getDeptData(AuthUtil.getDeptId())); + sccAnswerAlarm.setAlarmType(Func.isNotEmpty(sccAnswerAlarm.getAlarmType()) ? sccAnswerAlarm.getAlarmType() : Constant.ALARM_TYPE_OTHER); + sccAnswerAlarm.setPushState(Constant.PUSH_STATE_ONE.equals(sccAnswerAlarmDTO.getSubmitType()) ? Constant.PUSH_STATE_ZERO : sccAnswerAlarmDTO.getSubmitType()); + sccAnswerAlarm.setState(Constant.PUSH_STATE_ONE.equals(sccAnswerAlarmDTO.getSubmitType()) ? Constant.HANDIN_STATE_AUDIT : Constant.HANDIN_STATE_DRAFT); + boolean b; + if (Func.isNotEmpty(sccAnswerAlarmDTO.getId())) { + b = this.update(sccAnswerAlarm, new UpdateWrapper().lambda().eq(SccAnswerAlarm::getId, sccAnswerAlarmDTO.getId()).eq(SccAnswerAlarm::getPushState, Constant.PUSH_STATE_ZERO)); + } else { + b = this.save(sccAnswerAlarm); + } + //保存相关附件 + if (b) { + fileService.saveAttachments(sccAnswerAlarmDTO.getRelevantAttachments(), sccAnswerAlarm.getId()); + } + log.info("==============新增/编辑联系接警记详情录结束=============="); + //判断是否进行警情推送 + if (sccAnswerAlarmDTO.getSubmitType().equals(Constant.SUBMIT_TYPE_ONE)) { + // sccAlarmPushService.senAlarmNotice(sccAnswerAlarm); + return startProcess(sccAnswerAlarm); + } + return true; + } + + public boolean startProcess(SccAnswerAlarm sccAnswerAlarm) { + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.SCC_ANSWER_ALARM_KEY); + if (definitionRes.isSuccess()) { + sccAnswerAlarm.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + Kv variables = Kv.create() + .set(ProcessConstant.BUSINESS_ID_KEY, sccAnswerAlarm.getId()) + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + String businessTable = FlowUtil.getBusinessTable(SccAlarmPush.class); + R result = flowClient.startProcessInstanceById(sccAnswerAlarm.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(sccAnswerAlarm.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + sccAnswerAlarm.setProcessInstanceId(result.getData().getProcessInstanceId()); + } else { + throw new ServiceException("开启流程失败"); + } + this.saveOrUpdate(sccAnswerAlarm); + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean removeData(List toLongList) { + log.info("==============删除联系接警记详情录开始=============="); + //删除联系记录 + //删除相关附件 + boolean b = this.removeByIds(toLongList); + boolean b1 = fileService.removeFileData(toLongList); + log.info("==============删除联系接警记详情录结束=============="); + return b && b1; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R handIn(SccAlarmPushDTO sccAlarmPushDTO) { + log.info("==============警情信息提报开始=============="); + SccAlarmPush alarmPush = Func.copy(sccAlarmPushDTO, SccAlarmPush.class); + alarmPush.setPushState(Constant.PUSH_STATE_TWO); + alarmPush.setStatus(Constant.PUSH_STATUS_ONE); + alarmPush.setState(Constant.HANDIN_STATE_AUDIT); + boolean b = sccAlarmPushService.update(alarmPush, new UpdateWrapper().lambda() + .eq(Func.isNotEmpty(sccAlarmPushDTO.getId()), SccAlarmPush::getId, sccAlarmPushDTO.getId()) + .eq(SccAlarmPush::getPushState, Constant.PUSH_STATE_ONE) + .or().eq(Func.isNotEmpty(sccAlarmPushDTO.getId()), SccAlarmPush::getId, sccAlarmPushDTO.getId()) + .eq(SccAlarmPush::getState, Constant.HANDIN_STATE_REFUSE) + .eq(Func.isNotEmpty(sccAlarmPushDTO.getId()), SccAlarmPush::getId, sccAlarmPushDTO.getId()) + .eq(SccAlarmPush::getPushState, Constant.PUSH_STATE_TWO) + .or().eq(Func.isNotEmpty(sccAlarmPushDTO.getId()), SccAlarmPush::getId, sccAlarmPushDTO.getId()) + .eq(SccAlarmPush::getState, ProcessConstant.CANCEL_STATE) + .eq(Func.isNotEmpty(sccAlarmPushDTO.getId()), SccAlarmPush::getId, sccAlarmPushDTO.getId()) + .eq(SccAlarmPush::getPushState, Constant.PUSH_STATE_TWO)); + if (!b) { + return R.fail(400, "该警情信息已经被提报,请勿重复提报"); + } + //更新附件和处理情况信息更新 + if (Func.isNotEmpty(sccAlarmPushDTO.getLinkId())) { + fileService.saveAttachments(sccAlarmPushDTO.getRelevantAttachments(), sccAlarmPushDTO.getLinkId()); + SccAnswerAlarm answerAlarm = this.getById(sccAlarmPushDTO.getLinkId()); + answerAlarm.setTreatment(sccAlarmPushDTO.getTreatment()); + answerAlarm.setRemark(sccAlarmPushDTO.getRemark()); + this.updateById(answerAlarm); + } else { + fileService.saveAttachments(sccAlarmPushDTO.getRelevantAttachments(), sccAlarmPushDTO.getId()); + } + + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.SCC_ALARM_PUSH_KEY); + if (definitionRes.isSuccess()) { + alarmPush.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + R sendDeptCategory = sysClient.getDeptCategory(Long.valueOf(sccAlarmPushDTO.getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + Kv variables = Kv.create() + .set(ProcessConstant.BUSINESS_ID_KEY, alarmPush.getId()) + .set("deptCategory", deptCategory.getData()) + .set("sendDeptCategory", sendDeptCategory.getData()) //警情推送方的机构类型: 总、分、支 + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + String businessTable = FlowUtil.getBusinessTable(SccAlarmPush.class); + R result = flowClient.startProcessInstanceById(alarmPush.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(alarmPush.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + alarmPush.setProcessInstanceId(result.getData().getProcessInstanceId()); + } else { + throw new ServiceException("开启流程失败"); + } + + sccAlarmPushService.saveOrUpdate(alarmPush); + + log.info("==============警情信息提报结束=============="); + return R.success("警情信息提报成功"); + } + + @Override + public List getAimStatisticsData(AnswerAlarmDataDTO answerAlarmDataDTO, List aimDepts) { + return baseMapper.getAimStatisticsData(answerAlarmDataDTO,aimDepts); + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public R afterFlowFinished(String id, Boolean pass, Map variables) { + Boolean result = false; + String state; + if (null == pass) { + state = ProcessConstant.CANCEL_STATE; + } else if (pass) { + state = ProcessConstant.PASS_STATE; + } else { + state = ProcessConstant.REJECT_STATE; + } + result = this.updateStateById(id, state); + //审批通过 + if (result && Func.isNotEmpty(pass) && pass){ + SccAnswerAlarm sccAnswerAlarm = this.getById(id); + sccAnswerAlarm.setPushState(Constant.PUSH_STATE_ONE); + this.updateById(sccAnswerAlarm); + } + return R.success("执行成功"); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccCheckLinesServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccCheckLinesServiceImpl.java new file mode 100644 index 0000000..5f361c0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccCheckLinesServiceImpl.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service.impl; + +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.trans.common.service.IFileService; +import org.security.trans.securityCommandCenter.dto.SccCheckLinesDTO; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import org.security.trans.securityCommandCenter.vo.SccCheckLinesVO; +import org.security.trans.securityCommandCenter.mapper.SccCheckLinesMapper; +import org.security.trans.securityCommandCenter.service.ISccCheckLinesService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 安保指挥中心-营业网点检查和自助银行检查记录明细 服务实现类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Service +@AllArgsConstructor +public class SccCheckLinesServiceImpl extends ServiceImpl implements ISccCheckLinesService { + + private final IFileService fileService; + + @Override + public SccCheckLinesVO getData(String id) { + //获取明细详情 + SccCheckLines checkLines = this.getById(id); + SccCheckLinesVO sccCheckLinesVO = Func.copy(checkLines, SccCheckLinesVO.class); + //获取相关附件信息 + assert sccCheckLinesVO != null; + sccCheckLinesVO.setRelevantAttachments(fileService.getAttachments(id,null)); + return sccCheckLinesVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean updateData(SccCheckLinesDTO sccCheckLinesDTO) { + //保存提报记录信息 + SccCheckLines sccCheckLines = Func.copy(sccCheckLinesDTO, SccCheckLines.class); + //根据用户操作设置明细状态:若用户以暂存提交则状态不变,若用户以提报形式提交数据则状态要变为已整改 + assert sccCheckLines != null; + sccCheckLines.setCheckStatus(Constant.SUBMIT_TYPE_ZERO.equals(sccCheckLinesDTO.getSubmitType())?Constant.CHECK_STATUS_ZERO:Constant.CHECK_STATUS_TWO); + this.saveOrUpdate(sccCheckLines); + //保存提报记录的相关附件信息 + fileService.saveAttachments(sccCheckLinesDTO.getRelevantAttachments(),sccCheckLines.getId()); + return true; + } + + @Override + public List selectDetailPage(IPage page, SccCheckLinesDTO sccCheckLinesDTO) { + return baseMapper.selectDetailPage(page,sccCheckLinesDTO); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccCheckServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccCheckServiceImpl.java new file mode 100644 index 0000000..9eb34a7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccCheckServiceImpl.java @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.util.DataFormatUtil; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.feign.ISysClient; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.dto.UnlocaleCheckDataDTO; +import org.security.trans.dataStatistics.vo.UnlocaleCheckDataVO; +import org.security.trans.securityCommandCenter.dto.SccCheckDTO; +import org.security.trans.securityCommandCenter.dto.SccCheckLinesDTO; +import org.security.trans.securityCommandCenter.entity.SccCheck; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import org.security.trans.securityCommandCenter.service.ISccCheckLinesService; +import org.security.trans.securityCommandCenter.service.ISccUnlocaleCheckService; +import org.security.trans.securityCommandCenter.vo.SccCheckLinesVO; +import org.security.trans.securityCommandCenter.vo.SccCheckVO; +import org.security.trans.securityCommandCenter.mapper.SccCheckMapper; +import org.security.trans.securityCommandCenter.service.ISccCheckService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckVO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 安保指挥长中心-营业网点检查和自主银行检查记录 服务实现类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Slf4j +@Service +@AllArgsConstructor +public class SccCheckServiceImpl extends ServiceImpl implements ISccCheckService { + + private final ISccCheckLinesService sccCheckLinesService; + private final IDepartmentService departmentService; + private final IFileService fileService; + private final ISccUnlocaleCheckService sccUnlocaleCheckService; + private final ISysClient sysClient; + private final IFlowClient flowClient; + private final IInspectionService iInspectionService; + + @Override + public IPage selectSccCheckPage(IPage page, SccCheckDTO sccCheckDTO) { + List sccCheckVOS = baseMapper.selectSccCheckPage(page,sccCheckDTO); + if(sccCheckVOS.size()>0){ + sccCheckVOS.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + return page.setRecords(sccCheckVOS); + } + + @Override + public SccCheckVO getData(String id) { + log.info("==============获取营业网点检查/自助银行检查日志详情开始=============="); + //获取营业网点检查或自助银行检查记录 + SccCheck sccCheck = this.getById(id); + SccCheckVO checkVO = Func.copy(sccCheck, SccCheckVO.class); + // 创建人名称 + checkVO.setCreatedByName(fileService.getUserNameById(checkVO.getCreatedBy())); + // 更新人名称 + checkVO.setUpdatedByName(fileService.getUserNameById(checkVO.getUpdatedBy())); + //获取营业网点检查或自助银行检查记录明细 + List list = sccCheckLinesService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(sccCheck.getId()), SccCheckLines::getFormId, sccCheck.getId())); + checkVO.setSccCheckLinesList(Func.copy(list, SccCheckLinesVO.class)); + //获取关联的整改通知书列表 + List listNotice = sccUnlocaleCheckService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(sccCheck.getId()), SccUnlocaleCheck::getLinkFormId, sccCheck.getId())); + checkVO.setSccUnlocaleCheckVOS(Func.copy(listNotice, SccUnlocaleCheckVO.class)); + + //获取营业网点检查或自助银行检查记录明细的相关附件 + checkVO.getSccCheckLinesList().forEach(item -> { + item.setRelevantAttachments(fileService.getAttachments(item.getId(), null)); + }); + log.info("==============获取营业网点检查/自助银行检查日志详情结束=============="); + return checkVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveCheckData(SccCheckDTO sccCheckDTO) throws ParseException { + log.info("==============营业网点检查/自助银行检查日志录入开始=============="); + //保存检查记录 + SccCheck sccCheck = Func.copy(sccCheckDTO, SccCheck.class); + sccCheck.setDutyTime(DataFormatUtil.getLocalDate()); + sccCheck.setDeptId(AuthUtil.getDeptId()); + sccCheck.setState(Constant.HANDIN_STATE_DRAFT);//默认状态为 0-已提交状态 + sccCheck.setDeptName(iInspectionService.getDeptData(AuthUtil.getDeptId())); + // 先save一次,获得id + this.saveOrUpdate(sccCheck); + //保存检查记录明细 + List sccCheckLinesList = Func.copy(sccCheckDTO.getSccCheckLinesDTOList(), SccCheckLines.class); +// 若有异常项则挂载审批流 + if (sccCheckLinesList.stream().filter(sccCheckLines -> Constant.CHECK_STATUS_ZERO.equals(sccCheckLines.getCheckStatus())).collect(Collectors.toList()).size() > 0) { + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.SCC_CHECK_KEY); + if (definitionRes.isSuccess()) { + sccCheck.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + String businessTable = FlowUtil.getBusinessTable(SccCheck.class); + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, sccCheck.getId()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + R result = flowClient.startProcessInstanceById(sccCheck.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(sccCheck.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + // 返回流程id写入dutyRecords + sccCheck.setProcessInstanceId(result.getData().getProcessInstanceId()); + sccCheck.setState(Constant.HANDIN_STATE_AUDIT); + } else { + throw new ServiceException("流程启动失败"); + } + } + this.updateById(sccCheck); + if (Func.isNotEmpty(sccCheckLinesList)) { + sccCheckLinesList.forEach(item -> { + item.setFormId(sccCheck.getId()); + //给营业网点名称赋值 + item.setOutletsName(departmentService.getById(item.getOutletsCode()).getDeptName()); + }); + } + sccCheckLinesService.saveOrUpdateBatch(sccCheckLinesList); + log.info("==============营业网点检查/自助银行检查日志录入结束=============="); + return true; + } + + /** + * 审批通过后回调该接口创建整改通知书 + * @param id + * @return + */ + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean createdCheackNotice(String id) { + SccCheck sccCheck = this.getById(id); + List list = sccCheckLinesService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(id), SccCheckLines::getFormId, id)); + //若安防设施设备运行情况/自助机具及安防设施设备运行情况存在异常状态则发起检查整改通知书 + List collect = list.stream().filter(item -> Constant.CHECK_STATUS_ZERO.equals(item.getCheckStatus())).collect(Collectors.toList()); + if (Func.isNotEmpty(collect)) { + return sccUnlocaleCheckService.startRectedNotice(sccCheck, collect); + } + return false; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean removeData(List toLongList) { + log.info("==============营业网点检查/自助银行检查日志删除开始=============="); + //删除检查记录 + this.removeByIds(toLongList); + //删除检查记录相关明细 + List list = new ArrayList<>(); + toLongList.forEach(item ->{ + SccCheckLines sccCheckLines = sccCheckLinesService.getById(item); + list.add(sccCheckLines.getId()); + }); + boolean b = sccCheckLinesService.removeByIds(list); + //删除检查记录明细相关附件 + boolean b1 = fileService.removeFileData(list); + log.info("==============营业网点检查/自助银行检查日志删除结束=============="); + return b && b1; + } + + @Override + public IPage selectDetailPage(IPage page, SccCheckLinesDTO sccCheckLinesDTO) { + log.info("==============获取营业网点检查/自助银行检查日志开始=============="); + List list; + //获取检查结果异常项列表 + list = sccCheckLinesService.selectDetailPage(page,sccCheckLinesDTO); + if (Func.isNotEmpty(list)){ + list.forEach(item -> { + SccCheck sccCheck = this.getById(item.getFormId()); + item.setPersonOnDuty(sccCheck.getPersonOnDuty()); + item.setDutyTime(sccCheck.getDutyTime()); + item.setCheckType(sccCheck.getCheckType()); + //前端按钮控制筛选:当前登录机构是问题整改机构则有查看和编辑功能,当前登录机构不是问题整改机构则只有查看功能 + item.setButtonStatus(item.getOutletsCode().equals(AuthUtil.getDeptId()) ? Constant.BUTTON_STATE_ONE : Constant.BUTTON_STATE_THREE); + }); + } + //根据前端页面筛选出营业网点检查或自助银行检查的数据数据 + list = list.stream().filter(item -> item.getCheckType().equals(sccCheckLinesDTO.getCheckType())).collect(Collectors.toList()); + //如果查询筛选条件值班人员不为空 + if (Func.isNotBlank(sccCheckLinesDTO.getPersonOnDuty())){ + list = list.stream().filter(item -> item.getPersonOnDuty().equals(sccCheckLinesDTO.getPersonOnDuty())).collect(Collectors.toList()); + } + //如果查询筛选条件值班时间不为空 + if (Func.isNotEmpty(sccCheckLinesDTO.getDutyTime())) { + list = list.stream().filter(item -> item.getDutyTime().equals(sccCheckLinesDTO.getDutyTime())).collect(Collectors.toList()); + } + log.info("==============获取营业网点检查/自助银行检查日志结束=============="); + return page.setRecords(list); + } + + @Override + public List getAimStatisticsData(UnlocaleCheckDataDTO unlocaleCheckDataDTO, List aimDepts) { + return baseMapper.getAimStatisticsData(unlocaleCheckDataDTO,aimDepts); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccMsgSendServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccMsgSendServiceImpl.java new file mode 100644 index 0000000..575d78d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccMsgSendServiceImpl.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service.impl; + +import lombok.AllArgsConstructor; +import org.security.trans.common.service.IFileService; +import org.security.trans.securityCommandCenter.entity.SccMsgSend; +import org.security.trans.securityCommandCenter.vo.SccMsgSendVO; +import org.security.trans.securityCommandCenter.mapper.SccMsgSendMapper; +import org.security.trans.securityCommandCenter.service.ISccMsgSendService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * 安保指挥中心-警情推送记录 服务实现类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Service +@AllArgsConstructor +public class SccMsgSendServiceImpl extends ServiceImpl implements ISccMsgSendService { + private final IFileService fileService; + + @Override + public IPage selectSccMsgSendPage(IPage page, SccMsgSendVO sccMsgSend) { + List voList =baseMapper.selectSccMsgSendPage(page, sccMsgSend); + if(voList.size()>0){ + voList.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + return page.setRecords(voList); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccUnlocaleCheckLineServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccUnlocaleCheckLineServiceImpl.java new file mode 100644 index 0000000..60bf1f4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccUnlocaleCheckLineServiceImpl.java @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service.impl; + +import com.alibaba.druid.util.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import lombok.AllArgsConstructor; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.feign.ISysClient; +import org.security.trans.common.service.IFileService; +import org.security.trans.securityCommandCenter.dto.ContinuedRecDataDTO; +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckLineDTO; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import org.security.trans.securityCommandCenter.vo.ContinuedRecDataVO; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckLineVO; +import org.security.trans.securityCommandCenter.mapper.SccUnlocaleCheckLineMapper; +import org.security.trans.securityCommandCenter.service.ISccUnlocaleCheckLineService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.api.R; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 安保指挥中心-非现场检查整改明细 服务实现类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Service +@AllArgsConstructor +public class SccUnlocaleCheckLineServiceImpl extends ServiceImpl implements ISccUnlocaleCheckLineService { + private final IFileService fileService; + private final ISysClient sysClient; + private final IFlowClient flowClient; + + @Override + public IPage selectSccUnlocaleCheckLinePage(IPage page, SccUnlocaleCheckLineVO sccUnlocaleCheckLine) { + return page.setRecords(baseMapper.selectSccUnlocaleCheckLinePage(page, sccUnlocaleCheckLine)); + } + + @Override + public List getContinuedPage(IPage page, ContinuedRecDataDTO continuedRecDataDTO) { + return baseMapper.getContinuedPage(page,continuedRecDataDTO); + } + + @Override + public SccUnlocaleCheckLineVO getData(String id) { + SccUnlocaleCheckLine unlocaleCheckLine = this.getById(id); + SccUnlocaleCheckLineVO vo = Func.copy(unlocaleCheckLine, SccUnlocaleCheckLineVO.class); + //获取检查整改通知书明细相关附件 + vo.setRelevantAttachments(fileService.getAttachments(vo.getId(),vo.getGroupName())); + return vo; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveData(SccUnlocaleCheckLineDTO sccUnlocaleCheckLineDTO) { + SccUnlocaleCheckLine checkLine = Func.copy(sccUnlocaleCheckLineDTO, SccUnlocaleCheckLine.class); + checkLine.setRectificationEndTime(new Date()); + checkLine.setDeptId(AuthUtil.getDeptId()); +// checkLine.setRecFlag(Func.isNotEmpty(sccUnlocaleCheckLineDTO.getRecordFlag()) ? sccUnlocaleCheckLineDTO.getRecordFlag() : Constant.PROBLEM_STATE_USUUAL); + this.saveOrUpdate(checkLine); + //保存附件 + fileService.saveAttachments(sccUnlocaleCheckLineDTO.getRelevantAttachments(),checkLine.getId()); + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R startProcess(SccUnlocaleCheckLine unlocaleCheckLine, String deptId) { + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.SCC_UNLOCAL_CHECK_CONTINUE_KEY); + if (definitionRes.isSuccess()) { + unlocaleCheckLine.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + return R.fail("开启流程失败"); + } + String businessTable = FlowUtil.getBusinessTable(SccUnlocaleCheckLine.class); + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + return R.fail("查询部门类型失败,请检查后再试!"); + } + R sendDeptCategory = sysClient.getDeptCategory(Long.valueOf(deptId)); + if (!sendDeptCategory.isSuccess()) { + return R.fail("查询推送部门类型失败,请检查后再试!"); + } + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set("sendDeptCategory", sendDeptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, unlocaleCheckLine.getId()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + R result = flowClient.startProcessInstanceById(unlocaleCheckLine.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(unlocaleCheckLine.getId())), variables); + if (result.isSuccess()) { + unlocaleCheckLine.setProcessInstanceId(result.getData().getProcessInstanceId()); + } else { + return R.fail("开启流程失败"); + } + return R.status(this.updateById(unlocaleCheckLine)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R afterFlowFinished(String id, Boolean pass, Map variables) { + Boolean result = false; + String state; + if (null == pass) { + state = ProcessConstant.CANCEL_STATE; + } else if (pass) { + state = ProcessConstant.PASS_STATE; + } else { + state = ProcessConstant.REJECT_STATE; + } + result = this.updateStateById(id, state); + if (result) { + SccUnlocaleCheckLine unlocaleCheckLines = this.getOne(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(id), SccUnlocaleCheckLine::getId, id) + .eq(SccUnlocaleCheckLine::getDelFlag, Constant.DELETE_FLAG_0)); + if (Func.isNotEmpty(unlocaleCheckLines)) { + if (Func.isNotEmpty(pass) && pass) { + //持续整改记录再次申请持续整改 + if (Constant.PROBLEM_STATE_SIX.equals(unlocaleCheckLines.getStatus())){ + result = this.update(new UpdateWrapper().lambda().set(SccUnlocaleCheckLine::getStatus, Constant.PROBLEM_STATE_DRAFT_ONE).eq(SccUnlocaleCheckLine::getId, unlocaleCheckLines.getId())); + } + //持续整改记录提报 + if (Constant.PROBLEM_STATE_DRAFT_ONE.equals(unlocaleCheckLines.getStatus())){ + String aimStatus = Func.isEmpty(unlocaleCheckLines.getRectificationDeadline()) || unlocaleCheckLines.getRectificationDeadline().before(new Date()) ? Constant.PROBLEM_STATE_WAIT_TWO : Constant.PROBLEM_STATE_THREE; + result = this.update(new UpdateWrapper().lambda().set(SccUnlocaleCheckLine::getStatus,aimStatus).eq(SccUnlocaleCheckLine::getId, unlocaleCheckLines.getId())); + } + } + if (!result){ + log.error("审批更新业务表单失败"); + return R.fail("审批更新业务表单失败"); + } + + } + } + return R.success("执行成功"); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccUnlocaleCheckServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccUnlocaleCheckServiceImpl.java new file mode 100644 index 0000000..c2cdead --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/service/impl/SccUnlocaleCheckServiceImpl.java @@ -0,0 +1,547 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.security.common.Constant; +import org.security.common.config.CommonProperties; +import org.security.common.util.DataFormatUtil; +import org.security.common.util.DocumentNumberUtil; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.system.feign.ISysClient; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.RectificationNoticeDataVO; +import org.security.trans.securityCommandCenter.dto.ContinuedRecDataDTO; +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckDTO; +import org.security.trans.securityCommandCenter.dto.SccUnlocaleCheckLineDTO; +import org.security.trans.securityCommandCenter.entity.SccCheck; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import org.security.trans.securityCommandCenter.service.ISccUnlocaleCheckLineService; +import org.security.trans.securityCommandCenter.vo.ContinuedRecDataVO; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckLineVO; +import org.security.trans.securityCommandCenter.vo.SccUnlocaleCheckVO; +import org.security.trans.securityCommandCenter.mapper.SccUnlocaleCheckMapper; +import org.security.trans.securityCommandCenter.service.ISccUnlocaleCheckService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.text.ParseException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 安保指挥中心-非现场检查整改通知书 服务实现类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Slf4j +@Service +@AllArgsConstructor +public class SccUnlocaleCheckServiceImpl extends ServiceImpl implements ISccUnlocaleCheckService { + private final IDepartmentService departmentService; + private final ISccUnlocaleCheckLineService sccUnlocaleCheckLineService; + private final IFileService fileService; + private final CommonProperties commonProperties; + private final ISysClient sysClient; + private final IFlowClient flowClient; + private final IInspectionService iInspectionService; + + @Override + public IPage selectSccUnlocaleCheckPage(IPage page, SccUnlocaleCheckDTO sccUnlocaleCheckDTO) { + List unlocaleCheckList = new ArrayList<>(); + //获取非现场检查整改下发任务列表页数据 + if (Constant.SUBMIT_TYPE_ZERO.equals(sccUnlocaleCheckDTO.getMenuType())) { + unlocaleCheckList = baseMapper.selectGiveUpData(page, sccUnlocaleCheckDTO); + if (Func.isNotEmpty(unlocaleCheckList)) { + log.info("==============获取非现场检查整改下发任务列表页数据开始=============="); + unlocaleCheckList.forEach(item -> { + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + //设置前端可编辑状态字段 +// if (Constant.PROBLEM_STATE_ZORE.equals(item.getStatus()) && String.valueOf(AuthUtil.getUserId()).equals(item.getInspectStaff())) { +// item.setButtonStatus(Constant.BUTTON_STATE_ZERO); +// } + if (Constant.PROBLEM_STATE_ZORE.equals(item.getStatus())) { + item.setButtonStatus(Constant.BUTTON_STATE_ZERO); + } else { + item.setButtonStatus(Constant.BUTTON_STATE_THREE); + } + }); + log.info("==============获取非现场检查整改下发任务列表页数据结束=============="); + } + } + //获取非现场检查整改上报任务列表页数据 + if (Constant.SUBMIT_TYPE_ONE.equals(sccUnlocaleCheckDTO.getMenuType())) { + log.info("==============获取非现场检查整改上报任务列表页数据开始=============="); + unlocaleCheckList = baseMapper.selectHandInData(page, sccUnlocaleCheckDTO); + if (Func.isNotEmpty(unlocaleCheckList)){ + unlocaleCheckList.forEach(item ->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + item.setInspectDeptName(departmentService.getById(item.getInspectDept()).getDeptName()); + item.setButtonStatus(Constant.BUTTON_STATE_THREE); + if ((item.getRectificationResponsiblePerson().contains(String.valueOf(AuthUtil.getUser().getUserId())) + && item.getStatus().equals(Constant.PROBLEM_STATE_DRAFT_ONE)) + ||(item.getRectificationResponsiblePerson().contains(String.valueOf(AuthUtil.getUser().getUserId())) + && (Constant.HANDIN_STATE_REFUSE.equals(item.getState()) + || ProcessConstant.CANCEL_STATE.equals(item.getState())))){ + item.setButtonStatus(Constant.BUTTON_STATE_ONE); + } + }); + } + log.info("==============获取非现场检查整改上报任务列表页数据结束=============="); + } + //处理检查机构、检查人 + unlocaleCheckList.forEach(this::setUserAndDeptName); + List vos = unlocaleCheckList.stream().sorted(Comparator.comparing(SccUnlocaleCheckVO::getUpdatedTime,Comparator.nullsLast(Comparator.reverseOrder()))).collect(Collectors.toList()); + return page.setRecords(vos); + } + + //处理检查机构、检查人 + private void setUserAndDeptName(SccUnlocaleCheckVO item) { + item.setInspectDept(departmentService.getById(item.getInspectDept()).getDeptName()); + String userName = baseMapper.getUserName(item.getInspectStaff()); + item.setInspectStaff(Func.isNotEmpty(userName) ? userName : item.getInspectStaff()); + item.setInspectedDept(departmentService.getById(item.getInspectedDept()).getDeptName()); + item.setRecPersonName(Func.isNotEmpty(item.getRectificationResponsiblePerson()) ? baseMapper.getUserName(item.getRectificationResponsiblePerson()) : ""); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveData(SccUnlocaleCheckDTO sccUnlocaleCheckDTO) { + log.info("==============暂存或下发非现场检查整改通知书=============="); + SccUnlocaleCheck unlocaleCheck = Func.copy(sccUnlocaleCheckDTO, SccUnlocaleCheck.class); + if(Func.isEmpty(sccUnlocaleCheckDTO.getInspectDept())){ + unlocaleCheck.setInspectDept(AuthUtil.getDeptId()); + } + if(Func.isEmpty(sccUnlocaleCheckDTO.getInspectStaff())){ + unlocaleCheck.setInspectStaff(String.valueOf(AuthUtil.getUser().getUserId())); + } + if(Func.isEmpty(sccUnlocaleCheckDTO.getDeptId())){ + unlocaleCheck.setDeptId(AuthUtil.getDeptId()); + unlocaleCheck.setDeptName(iInspectionService.getDeptData(AuthUtil.getDeptId())); + } + //生成文号 + if(Func.isEmpty(sccUnlocaleCheckDTO.getDocumentNo())){ + unlocaleCheck.setDocumentNo(DocumentNumberUtil.createdDocumentNumber()); + log.info("整改通知书文号生成【】" + unlocaleCheck.getDocumentNo()); + } + //暂存SubmitType=0--->暂存Status=0 下发SubmitType=1----->待整改Status=1 + unlocaleCheck.setStatus(Constant.SUBMIT_TYPE_ZERO.equals(sccUnlocaleCheckDTO.getSubmitType()) ? Constant.PROBLEM_STATE_ZORE : Constant.PROBLEM_STATE_DRAFT_ONE); + unlocaleCheck.setState(Constant.HANDIN_STATE_DRAFT); + //主表记录保存/更新 + if (Func.isNotEmpty(sccUnlocaleCheckDTO.getId())) { + this.update(unlocaleCheck,new UpdateWrapper().lambda() + .eq(SccUnlocaleCheck::getId,sccUnlocaleCheckDTO.getId()).eq(SccUnlocaleCheck::getStatus,Constant.PROBLEM_STATE_DRAFT)); + }else { + this.saveOrUpdate(unlocaleCheck); + } + //保存整改通知书相关附件 + fileService.saveAttachments(sccUnlocaleCheckDTO.getRelevantAttachments(),unlocaleCheck.getId()); + //整改明细记录保存 + if (Func.isNotEmpty(sccUnlocaleCheckDTO.getSccUnlocaleCheckLineDTOList())) { + List unlocaleCheckLines = Func.copy(sccUnlocaleCheckDTO.getSccUnlocaleCheckLineDTOList(), SccUnlocaleCheckLine.class); + unlocaleCheckLines.forEach(item -> { + item.setFormId(unlocaleCheck.getId()); + item.setRecFlag(Constant.PROBLEM_STATE_USUUAL); + item.setStatus(Constant.PROBLEM_STATE_DRAFT_ONE); + item.setState(Constant.HANDIN_STATE_DRAFT); + item.setDeptId(AuthUtil.getDeptId()); + item.setOutletsName(departmentService.getById(item.getOutletsCode()).getDeptName()); + }); + sccUnlocaleCheckLineService.saveOrUpdateBatch(unlocaleCheckLines); + } + //前端点击了下发整改通知书,则将该记录挂载到流程上,该记录现在的状态是待下发,若审批通过回调变更该记录状态为待整改 + if (Constant.PROBLEM_STATE_SIX.equals(unlocaleCheck.getStatus())){ + //TODO 挂在流程 + } + log.info("==============非现场检查整改通知书创建完成=============="); + return true; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean handInData(SccUnlocaleCheckDTO sccUnlocaleCheckDTO) throws ParseException { + log.info("==============整改通知书提报开始=============="); + //暂存 + if (Constant.SUBMIT_TYPE_ZERO.equals(sccUnlocaleCheckDTO.getSubmitType())) { + return true; + } + //提报非现场检查整改结果 + if (Constant.SUBMIT_TYPE_ONE.equals(sccUnlocaleCheckDTO.getSubmitType())) { + //更新主表状态 + SccUnlocaleCheck unlocaleCheck = Func.copy(sccUnlocaleCheckDTO, SccUnlocaleCheck.class); + //超时整改 + if (unlocaleCheck.getRectificationDeadline().before(DataFormatUtil.getLocalDate())) { + unlocaleCheck.setStatus(Constant.PROBLEM_STATE_THREE); + }//按时整改 + else { + unlocaleCheck.setStatus(Constant.PROBLEM_STATE_WAIT_TWO); + } + unlocaleCheck.setState(Constant.HANDIN_STATE_AUDIT); + //更新主表状态 + updateById(unlocaleCheck); + //更新检查整改明细 + updateData(sccUnlocaleCheckDTO,unlocaleCheck.getState()); + //开启流程 + startFlow(unlocaleCheck); + } + log.info("==============整改通知书提报结束=============="); + return true; + } + + /** + * 开启流程 + */ + private void startFlow(SccUnlocaleCheck unlocaleCheck) { + R definitionRes = flowClient.getLatestProcessDefinitionByKey(ProcessConstant.SCC_UNLOCAL_CHECK_KEY); + if (definitionRes.isSuccess()) { + unlocaleCheck.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + throw new ServiceException("开启流程失败"); + } + String businessTable = FlowUtil.getBusinessTable(SccUnlocaleCheck.class); + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + R sendDeptCategory = sysClient.getDeptCategory(Long.valueOf(unlocaleCheck.getDeptId())); + if (!sendDeptCategory.isSuccess()) { + throw new ServiceException("查询推送部门类型失败,请检查后再试!"); + } + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set("sendDeptCategory", sendDeptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, unlocaleCheck.getId()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + R result = flowClient.startProcessInstanceById(unlocaleCheck.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(unlocaleCheck.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + unlocaleCheck.setProcessInstanceId(result.getData().getProcessInstanceId()); + } else { + throw new ServiceException("开启流程失败"); + } + updateById(unlocaleCheck); + } + + @Override + public SccUnlocaleCheckVO getData(String id) { + log.info("==============获取整改通知书详情开始=============="); + //获取主表记录 + SccUnlocaleCheck sccUnlocaleCheck = this.getById(id); + SccUnlocaleCheckVO sccUnlocaleCheckVO = Func.copy(sccUnlocaleCheck, SccUnlocaleCheckVO.class); + sccUnlocaleCheckVO.setInspectStaffName(Func.isNotEmpty(sccUnlocaleCheck.getLinkId()) ? sccUnlocaleCheck.getInspectStaff() : baseMapper.getUserName(sccUnlocaleCheck.getInspectStaff())); + sccUnlocaleCheckVO.setRecPersonName(Func.isNotEmpty(sccUnlocaleCheckVO.getRectificationResponsiblePerson()) ? fileService.getUserNameByIds(Func.toStrList(sccUnlocaleCheckVO.getRectificationResponsiblePerson())) : ""); + //获取检查整改通知书相关附件 + sccUnlocaleCheckVO.setRelevantAttachments(fileService.getAttachments(sccUnlocaleCheck.getId(),sccUnlocaleCheck.getGroupName())); + //获取明细记录 + List list = sccUnlocaleCheckLineService.list(new QueryWrapper().lambda() + .eq(Func.isNotBlank(id), SccUnlocaleCheckLine::getFormId, id) + .eq(SccUnlocaleCheckLine::getDelFlag,Constant.DELETE_FLAG_0) + .ne(SccUnlocaleCheckLine::getStatus,Constant.PROBLEM_STATE_SIX) + ); + if (Func.isNotEmpty(list)) { + List sccUnlocaleCheckLineVOList = Func.copy(list, SccUnlocaleCheckLineVO.class); + sccUnlocaleCheckLineVOList.forEach(item -> { + //获取附件信息 + item.setRelevantAttachments(fileService.getAttachments(item.getId(),item.getGroupName())); + }); + sccUnlocaleCheckVO.setInspectDeptName(departmentService.getById(sccUnlocaleCheckVO.getInspectDept()).getDeptName()); + //检查日志记录产生的非现场检查整改通知书,被检查单位名称赋值 + sccUnlocaleCheckVO.setInspectedDeptName(departmentService.getById(sccUnlocaleCheckVO.getInspectedDept()).getDeptName()); + sccUnlocaleCheckVO.setSccUnlocaleCheckLineVOList(sccUnlocaleCheckLineVOList); + } + log.info("==============获取整改通知书详情结束=============="); + return sccUnlocaleCheckVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean removeData(List toLongList) { + log.info("==============删除检查整改通知书开始=============="); + //删除主表记录 + //删除明细信息 + //删除相关附件 + List detailIdList = new ArrayList<>(); + toLongList.forEach(item -> { + List list = sccUnlocaleCheckLineService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(item), SccUnlocaleCheckLine::getFormId, item)); + if (Func.isNotEmpty(list)) { + list.forEach(d -> { + detailIdList.add(d.getId()); + }); + } + }); + boolean b = this.removeByIds(toLongList); + boolean b1 = sccUnlocaleCheckLineService.removeByIds(detailIdList); + boolean b2 = fileService.removeFileData(detailIdList); + log.info("==============删除检查整改通知书结束=============="); + return b && b1 && b2; + } + + @Override + public boolean startRectedNotice(SccCheck sccCheck, List collect) { + log.info("==============创建检查整改通知书开始=============="); + //创建检查整改通知书 + collect.forEach(item -> { + //保存主表记录 + SccUnlocaleCheck unlocaleCheck = null; + try { + unlocaleCheck = saveSccUnlocaleCheck(sccCheck, item); + } catch (ParseException e) { + e.printStackTrace(); + } + this.save(unlocaleCheck); + //保存明细表记录 + SccUnlocaleCheckLine sccUnlocaleCheckLine = saveSccUnlocaleCheckLine(item, unlocaleCheck); + sccUnlocaleCheckLineService.save(sccUnlocaleCheckLine); + }); + log.info("==============检查整改通知书创建完成=============="); + return true; + } + + @Override + public IPage getContinuedPage(IPage page, ContinuedRecDataDTO continuedRecDataDTO) { + ArrayList vos = new ArrayList<>(); + List list = sccUnlocaleCheckLineService.getContinuedPage(page,continuedRecDataDTO); + if (Func.isNotEmpty(list)){ + list.forEach(item ->{ + //获取主表信息 + SccUnlocaleCheck unlocaleCheck = this.getById(item.getFormId()); + ContinuedRecDataVO continuedRecDataVO = Func.copy(unlocaleCheck, ContinuedRecDataVO.class); + continuedRecDataVO.setId(item.getId()); + continuedRecDataVO.setInspectDept(departmentService.getById(unlocaleCheck.getInspectDept()).getDeptName()); + continuedRecDataVO.setInspectStaff(Func.isNotEmpty(unlocaleCheck.getLinkId())? unlocaleCheck.getInspectStaff() : baseMapper.getUserName(unlocaleCheck.getInspectStaff())); + continuedRecDataVO.setInspectedDept(departmentService.getById(unlocaleCheck.getInspectedDept()).getDeptName()); + continuedRecDataVO.setRecPersonName(Func.isNotEmpty(unlocaleCheck.getRectificationResponsiblePerson()) ? fileService.getUserNameByIds(Func.toStrList(unlocaleCheck.getRectificationResponsiblePerson())) : ""); + continuedRecDataVO.setRectificationDeadline(item.getRectificationDeadline()); + continuedRecDataVO.setStatus(item.getStatus()); + continuedRecDataVO.setState(item.getState()); + vos.add(continuedRecDataVO); + }); + } + return page.setRecords(vos); + } + + @Override + public SccUnlocaleCheckLineVO getContinuedDetail(String id) { + SccUnlocaleCheckLine sccUnlocaleCheckLine = sccUnlocaleCheckLineService.getById(id); + SccUnlocaleCheckLineVO vo = Func.copy(sccUnlocaleCheckLine, SccUnlocaleCheckLineVO.class); + //获取相关附件 + vo.setRelevantAttachments(fileService.getAttachments(sccUnlocaleCheckLine.getId(),sccUnlocaleCheckLine.getGroupName())); + return vo; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean handInContinuedRec(SccUnlocaleCheckLineDTO sccUnlocaleCheckLineDTO) throws ParseException { + SccUnlocaleCheckLine unlocaleCheckLine = Func.copy(sccUnlocaleCheckLineDTO,SccUnlocaleCheckLine.class); + //针对于持续整改记录,再次发起持续整改 + if (Constant.PROBLEM_STATE_CONTINUED.equals(sccUnlocaleCheckLineDTO.getRecordFlag())){ + //新增持续整改记录 + unlocaleCheckLine.setId(null); + unlocaleCheckLine.setStatus(Constant.PROBLEM_STATE_SIX); + unlocaleCheckLine.setState(Constant.HANDIN_STATE_DRAFT); + unlocaleCheckLine.setDeptId(AuthUtil.getDeptId()); + sccUnlocaleCheckLineService.save(unlocaleCheckLine); + //保存相关附件 + fileService.saveAttachments(sccUnlocaleCheckLineDTO.getRelevantAttachments(),unlocaleCheckLine.getId()); + //并且删除原明细记录 + sccUnlocaleCheckLineService.removeById(sccUnlocaleCheckLineDTO.getId()); + } + //提报持续整改记录 + Date deadline = Func.isNotEmpty(sccUnlocaleCheckLineDTO.getRectificationDeadline()) ? sccUnlocaleCheckLineDTO.getRectificationDeadline() : sccUnlocaleCheckLineService.getById(sccUnlocaleCheckLineDTO.getId()).getRectificationDeadline(); + if (deadline.before(DataFormatUtil.getLocalDate())){ + unlocaleCheckLine.setStatus(Constant.PROBLEM_STATE_THREE); + }else { + unlocaleCheckLine.setStatus(Constant.PROBLEM_STATE_WAIT_TWO); + } + unlocaleCheckLine.setState(Constant.HANDIN_STATE_AUDIT); + sccUnlocaleCheckLineService.saveOrUpdate(unlocaleCheckLine); + //保存相关附件 + fileService.saveAttachments(sccUnlocaleCheckLineDTO.getRelevantAttachments(),unlocaleCheckLine.getId()); + R lineRes = sccUnlocaleCheckLineService.startProcess(unlocaleCheckLine, unlocaleCheckLine.getDeptId()); + if (!lineRes.isSuccess()) { + return false; + } + return true; + } + + @Override + public List getListData(String status) { + return this.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(status),SccUnlocaleCheck::getStatus,status).eq(SccUnlocaleCheck::getDelFlag,Constant.DELETE_FLAG_0)); + } + + @Override + public List getStatisticsData(StatisticsDataDTO statisticsDataDTO, List aimDepts) { + return baseMapper.getStatisticsData(statisticsDataDTO,aimDepts); + } + + /** + *封装检查整改通知书明细表 + */ + private SccUnlocaleCheckLine saveSccUnlocaleCheckLine(SccCheckLines item, SccUnlocaleCheck unlocaleCheck) { + SccUnlocaleCheckLine sccUnlocaleCheckLine = new SccUnlocaleCheckLine(); + sccUnlocaleCheckLine.setFormId(unlocaleCheck.getId()); + sccUnlocaleCheckLine.setRecFlag(Constant.PROBLEM_STATE_USUUAL); + sccUnlocaleCheckLine.setStatus(Constant.PROBLEM_STATE_DRAFT_ONE); + sccUnlocaleCheckLine.setOutletsCode(item.getOutletsCode()); + sccUnlocaleCheckLine.setOutletsName(departmentService.getById(item.getOutletsCode()).getDeptName()); + sccUnlocaleCheckLine.setDiscoverProblemsTime(item.getCheckTime()); + sccUnlocaleCheckLine.setProblemsDescribe(item.getAbnormalConditions()); + sccUnlocaleCheckLine.setOutletsCodeFront(item.getOutletsCodeFront()); + return sccUnlocaleCheckLine; + } + + /** + *封装检查整改通知书主表数据 + */ + private SccUnlocaleCheck saveSccUnlocaleCheck(SccCheck sccCheck, SccCheckLines item) throws ParseException { + SccUnlocaleCheck unlocaleCheck = new SccUnlocaleCheck(); + unlocaleCheck.setDocumentNo(DocumentNumberUtil.createdDocumentNumber()); + unlocaleCheck.setInspectDept(AuthUtil.getDeptId()); + unlocaleCheck.setInspectStaff(sccCheck.getPersonOnDuty()); + unlocaleCheck.setDeptId(AuthUtil.getDeptId()); + unlocaleCheck.setRectificationDeadline(DataFormatUtil.getLocalDate()); + unlocaleCheck.setDeptName(departmentService.getById(unlocaleCheck.getDeptId()).getDeptName()); + unlocaleCheck.setLinkFormId(sccCheck.getId()); + unlocaleCheck.setLinkId(item.getId()); + //待下发状态的整改通知书,审批通过后变成待整改 +// unlocaleCheck.setStatus(Constant.PROBLEM_STATE_DRAFT_ONE); + //2023-11-20最新需求:检查日志审批通过后只是生成待下发状态的整改通知书,不要自动下发 + unlocaleCheck.setStatus(Constant.PROBLEM_STATE_DRAFT); + unlocaleCheck.setState(Constant.HANDIN_STATE_DRAFT); + //营业网点检查 + if (Constant.CHECK_TYPE_OUTLETS.equals(sccCheck.getCheckType())){ + unlocaleCheck.setInspectedDept(item.getOutletsCode()); + unlocaleCheck.setNoticeType(Constant.NOTICE_TYPE_ONE); + } + //自助银行检查 + if (Constant.CHECK_TYPE_SELF_BANK.equals(sccCheck.getCheckType())){ + //获取自助银行的直属营业机构 + unlocaleCheck.setInspectedDept(baseMapper.getDeptId(item.getOutletsCode())); + unlocaleCheck.setNoticeType(Constant.NOTICE_TYPE_TWO); + } + //根据机构号和角色名称获取责任整改人(整改机构的安全员) + List dutyPerson = baseMapper.getDutyPerson(unlocaleCheck.getInspectedDept(),commonProperties.getSecurityRoleName()); + unlocaleCheck.setRectificationResponsiblePerson(dutyPerson.size() > 0 ? StringUtils.join(dutyPerson,",") : null); + + + return unlocaleCheck; + } + + /** + * 更新检查整改明细 + */ + private void updateData(SccUnlocaleCheckDTO sccUnlocaleCheckDTO,String state) { + if (Func.isNotEmpty(sccUnlocaleCheckDTO.getSccUnlocaleCheckLineDTOList())) { + sccUnlocaleCheckDTO.getSccUnlocaleCheckLineDTOList().forEach(item -> { + SccUnlocaleCheckLine unlocaleCheckLine = Func.copy(item, SccUnlocaleCheckLine.class); + //持续整改 + if (Constant.PROBLEM_STATE_CONTINUED.equals(item.getRecordFlag()) && !Constant.HANDIN_STATE_REFUSE.equals(state)){ + //更新原有记录 + unlocaleCheckLine.setStatus(Constant.PROBLEM_STATE_DRAFT_ONE); + unlocaleCheckLine.setRecFlag(Constant.PROBLEM_STATE_USUUAL); + sccUnlocaleCheckLineService.updateById(unlocaleCheckLine); + //保存相关附件 + fileService.saveAttachments(item.getRelevantAttachments(), unlocaleCheckLine.getId()); + //新增持续整改记录 + SccUnlocaleCheckLine recCheckLine = new SccUnlocaleCheckLine(); + recCheckLine.setRecFlag(Constant.PROBLEM_STATE_CONTINUED); + recCheckLine.setStatus(Constant.PROBLEM_STATE_SIX); + recCheckLine.setState(Constant.HANDIN_STATE_DRAFT); + recCheckLine.setDeptId(item.getDeptId()); + recCheckLine.setRectificationDeadline(item.getRectificationDeadline()); + recCheckLine.setFormId(item.getFormId()); + recCheckLine.setProblemsDescribe(item.getProblemsDescribe()); + recCheckLine.setDiscoverProblemsTime(item.getDiscoverProblemsTime()); + recCheckLine.setOutletsCode(item.getOutletsCode()); + recCheckLine.setOutletsCodeFront(item.getOutletsCodeFront()); + recCheckLine.setOutletsName(item.getOutletsName()); + sccUnlocaleCheckLineService.save(recCheckLine); + //保存相关附件 + fileService.saveAttachments(item.getRelevantAttachments(), recCheckLine.getId()); + } + else { + sccUnlocaleCheckLineService.updateById(unlocaleCheckLine); + //保存相关附件 + fileService.saveAttachments(item.getRelevantAttachments(), unlocaleCheckLine.getId()); + } + }); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R afterFlowFinished(String id, Boolean pass, Map variables) { + Boolean result = false; + String state; + if (null == pass) { + state = ProcessConstant.CANCEL_STATE; + } else if (pass) { + state = ProcessConstant.PASS_STATE; + } else { + state = ProcessConstant.REJECT_STATE; + } + result = this.updateStateById(id, state); + if (result) { + List unlocaleCheckLines = sccUnlocaleCheckLineService.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(id), SccUnlocaleCheckLine::getFormId, id) + .eq(SccUnlocaleCheckLine::getDelFlag, Constant.DELETE_FLAG_0)); + if (Func.isNotEmpty(unlocaleCheckLines)) { + //筛选出持续整改记录明细 + List collect = unlocaleCheckLines.stream().filter(item -> Constant.PROBLEM_STATE_CONTINUED.equals(item.getRecFlag()) && Constant.PROBLEM_STATE_SIX.equals(item.getStatus())).map(SccUnlocaleCheckLine::getId).collect(Collectors.toList()); + if (Func.isNotEmpty(collect)) { + if (Func.isNotEmpty(pass) && pass) { + result = sccUnlocaleCheckLineService.update(new UpdateWrapper().lambda().set(SccUnlocaleCheckLine::getStatus, Constant.PROBLEM_STATE_DRAFT_ONE).in(SccUnlocaleCheckLine::getId, collect)); + } else { + result = sccUnlocaleCheckLineService.removeByIds(collect); + } + if (!result){ + log.error("审批更新业务表单失败"); + return R.fail("审批更新业务表单失败"); + } + } + } + } + return R.success("执行成功"); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/ContinuedRecDataVO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/ContinuedRecDataVO.java new file mode 100644 index 0000000..67229e4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/ContinuedRecDataVO.java @@ -0,0 +1,75 @@ +package org.security.trans.securityCommandCenter.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.entity.common.FlowEntity; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author :wzf + * @apiNote :持续整改记录信息 + * @since :Created in 2022/9/27 19:50 + */ +@Data +public class ContinuedRecDataVO extends FlowEntity implements Serializable { + + + + /** + * 文号 + */ + @ApiModelProperty(value = "文号") + private String documentNo; + + /** + * 检查单位 + */ + @ApiModelProperty(value = "检查单位") + private String inspectDept; + + /** + * 检查人 + */ + @ApiModelProperty(value = "检查人") + private String inspectStaff; + + /** + * 被检查单位 + */ + @ApiModelProperty(value = "被检查单位") + private String inspectedDept; + + /** + * 整改责任人 + */ + @ApiModelProperty(value = "整改责任人") + private String rectificationResponsiblePerson; + /** + * 整改责任人名称 + */ + @ApiModelProperty(value = "整改责任人名称") + private String recPersonName; + + /** + * 整改期限 + */ + @ApiModelProperty(value = "整改期限") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date rectificationDeadline; + + /** + * 状态;1-待整改,2-按时整改,3-超时整改 + */ + @ApiModelProperty(value = "状态;0-待下发,1-待整改,2-按时整改,3-超时整改,4-超时未整改") + private String status; + + /** + * 整改通知书类型(1-自助银行检查整改通知书,2-营业网点检查整改通知书,3-其他检查整改通知书) + */ + @ApiModelProperty(value = "整改通知书类型(1-营业网点检查整改通知书,2-自助银行检查整改通知书,3-其他检查整改通知书)") + private String noticeType; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccAlarmPushVO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccAlarmPushVO.java new file mode 100644 index 0000000..92a914f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccAlarmPushVO.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccAlarmPush; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 警情推送视图实体类 + * + * @author BladeX + * @since 2022-07-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SccAlarmPushVO对象", description = "警情推送") +public class SccAlarmPushVO extends SccAlarmPush { + private static final long serialVersionUID = 1L; + + /** + * 按钮显示控制标识符(0-(待推送状态)查看、编辑;3-查看 + */ + private String buttonStatus; + + /** + * 相关附件 + */ + private List relevantAttachments; + + /** + * 接收机构 + */ + private String receiveDeptName; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccAnswerAlarmVO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccAnswerAlarmVO.java new file mode 100644 index 0000000..b5454e4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccAnswerAlarmVO.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccAnswerAlarm; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.springblade.core.secure.utils.AuthUtil; + +import java.util.List; + +/** + * 安保指挥中心-联系接警记录视图实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SccAnswerAlarmVO对象", description = "安保指挥中心-联系接警记录") +public class SccAnswerAlarmVO extends SccAnswerAlarm { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + private boolean editable; + + public boolean isEditable() { + if ((Constant.PUSH_STATE_ZERO.equals(this.getPushState()) + || Constant.HANDIN_STATE_REFUSE.equals(this.getState()) + || ProcessConstant.CANCEL_STATE.equals(this.getState())) + && !Constant.HANDIN_STATE_AUDIT.equals(this.getState()) + && String.valueOf(AuthUtil.getUser().getUserId()).equals(this.getCreatedBy())){ + return true; + } + return editable; + } + + public boolean isDeletable() { + if (Constant.PUSH_STATE_ZERO.equals(this.getPushState()) && Constant.HANDIN_STATE_DRAFT.equals(this.getState())){ + return true; + } + return deletable; + } + + private boolean deletable; + + /** + * 相关附件 + */ + private List relevantAttachments; + + /** + * 地点 + */ + private String placeName; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccCheckLinesVO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccCheckLinesVO.java new file mode 100644 index 0000000..e927f98 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccCheckLinesVO.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +/** + * 安保指挥中心-营业网点检查和自助银行检查记录明细视图实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SccCheckLinesVO对象", description = "安保指挥中心-营业网点检查和自助银行检查记录明细") +public class SccCheckLinesVO extends SccCheckLines { + private static final long serialVersionUID = 1L; + /** + * 检查类型;1-营业网点检查、2-自助银行检查 + */ + @ApiModelProperty(value = "检查类型;1-营业网点检查、2-自助银行检查") + private String checkType; + /** + * 值班人员 + */ + @ApiModelProperty(value = "值班人员") + private String personOnDuty; + /** + * 值班时间 + */ + @ApiModelProperty(value = "值班时间") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GTM + 8") + private Date dutyTime; + + /** + * 按钮显示控制标识符(0-(待下发状态)查看、编辑;3-查看 + */ + private String buttonStatus; + + /** + * 相关附件 + */ + private List relevantAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccCheckVO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccCheckVO.java new file mode 100644 index 0000000..bea1e25 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccCheckVO.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.trans.securityCommandCenter.entity.SccCheck; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.trans.securityCommandCenter.entity.SccCheckLines; +import org.springblade.core.secure.utils.AuthUtil; + +import java.util.List; + +/** + * 安保指挥长中心-营业网点检查和自主银行检查记录视图实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SccCheckVO对象", description = "安保指挥长中心-营业网点检查和自主银行检查记录") +public class SccCheckVO extends SccCheck { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + private boolean editable; + public boolean isEditable() { + if((ProcessConstant.CANCEL_STATE.equals(this.getState()) || Constant.HANDIN_STATE_REFUSE.equals(this.getState())) + && this.getCreatedBy().equals(String.valueOf(AuthUtil.getUser().getUserId()))){ + return true; + } + return false; + } + + /** + * 营业网点检查和自主银行检查记录明细 + */ + private List sccCheckLinesList; + /** + * 关联的整改通知书列表 + */ + private List sccUnlocaleCheckVOS; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccMsgSendVO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccMsgSendVO.java new file mode 100644 index 0000000..95d786f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccMsgSendVO.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.trans.securityCommandCenter.entity.SccMsgSend; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 安保指挥中心-警情推送记录视图实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SccMsgSendVO对象", description = "安保指挥中心-警情推送记录") +public class SccMsgSendVO extends SccMsgSend { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccUnlocaleCheckLineVO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccUnlocaleCheckLineVO.java new file mode 100644 index 0000000..3166eba --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccUnlocaleCheckLineVO.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.vo; + +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 安保指挥中心-非现场检查整改明细视图实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SccUnlocaleCheckLineVO对象", description = "安保指挥中心-非现场检查整改明细") +public class SccUnlocaleCheckLineVO extends SccUnlocaleCheckLine { + private static final long serialVersionUID = 1L; + + /** + * 可持续整改标识(1-普通整改,2-持续整改) + */ + private String recordFlag; + + /** + * 相关附件 + */ + private List relevantAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccUnlocaleCheckVO.java b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccUnlocaleCheckVO.java new file mode 100644 index 0000000..5c87517 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/securityCommandCenter/vo/SccUnlocaleCheckVO.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.securityCommandCenter.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 安保指挥中心-非现场检查整改通知书视图实体类 + * + * @author BladeX + * @since 2022-07-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SccUnlocaleCheckVO对象", description = "安保指挥中心-非现场检查整改通知书") +public class SccUnlocaleCheckVO extends SccUnlocaleCheck { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + @ApiModelProperty(value = "整改责任人名称") + private String recPersonName; + /** + * 按钮显示控制标识符(0-(待下发状态)查看、编辑、删除;1-(待整改/超时未整改)查看、提报;2-(按时整改/超时整改)查看、驳回/通过);3-查看 + */ + private String buttonStatus; + + private List sccUnlocaleCheckLineVOList; + + /** + * 检查单位名称 + */ + @ApiModelProperty(value = "检查单位名称") + private String inspectDeptName; + + /** + * 被检查单位名称 + */ + @ApiModelProperty(value = "检查单位名称") + private String inspectedDeptName; + + /** + * 检查人 + */ + private String inspectStaffName; + + /** + * 相关附件 + */ + private List relevantAttachments; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/controller/BusinessTypeController.java b/security-service/ht-security/src/main/java/org/security/trans/settings/controller/BusinessTypeController.java new file mode 100644 index 0000000..4687c4a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/controller/BusinessTypeController.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.settings.dto.BusinessTypeDTO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.settings.entity.BusinessType; +import org.security.trans.settings.vo.BusinessTypeVO; +import org.security.trans.settings.service.IBusinessTypeService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.math.BigDecimal; +import java.text.ParseException; + +/** + * 公共-业务具体类型 控制器 + * + * @author BladeX + * @since 2022-04-01 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/businesstype") +@Api(value = "公共-业务具体类型", tags = "公共-业务具体类型接口") +public class BusinessTypeController extends BladeController { + + private final IBusinessTypeService businessTypeService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入businessType id") + public R detail(@PathVariable BigDecimal id) { + BusinessType detail = businessTypeService.getById(id); + BusinessTypeVO businessTypeVO = new BusinessTypeVO(); + BeanUtils.copyProperties(detail,businessTypeVO); + return R.data(businessTypeVO); + } + + /** + * 分页 公共-业务具体类型 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入businessType") + public R> list(BusinessType businessType, Query query) { + IPage pages = businessTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(businessType)); + return R.data(pages); + } + + /** + * 自定义分页 公共-业务具体类型 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入businessType") + public R> page(BusinessTypeVO businessType, Query query) { + IPage pages = businessTypeService.selectBusinessTypePage(Condition.getPage(query), businessType); + return R.data(pages); + } + + /** + * 新增 公共-业务具体类型 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入businessType") + public R save(@Valid @RequestBody BusinessTypeDTO businessType) throws ParseException { + return R.status(businessTypeService.saveBusinessType(businessType)); + } + + /** + * 修改 公共-业务具体类型 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入businessType") + public R update(@Valid @RequestBody BusinessType businessType) { + return R.status(businessTypeService.updateById(businessType)); + } + + /** + * 新增或修改 公共-业务具体类型 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入businessType") + public R submit(@Valid @RequestBody BusinessType businessType) { + return R.status(businessTypeService.saveOrUpdate(businessType)); + } + + + /** + * 删除 公共-业务具体类型 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(businessTypeService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/controller/DeviceCategorySettingsController.java b/security-service/ht-security/src/main/java/org/security/trans/settings/controller/DeviceCategorySettingsController.java new file mode 100644 index 0000000..c83f733 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/controller/DeviceCategorySettingsController.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.controller; + +import io.swagger.annotations.*; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + + +import org.security.trans.settings.dto.DeviceCategorySettingsDTO; +import org.security.trans.settings.wrapper.DCWrapper; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; + +import org.springblade.core.secure.annotation.PreAuth; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.constant.RoleConstant; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.vo.DeviceCategorySettingsVO; +import org.security.trans.settings.service.IDeviceCategorySettingsService; +import org.springblade.core.boot.ctrl.BladeController; +import springfox.documentation.annotations.ApiIgnore; + +import java.text.ParseException; +import java.util.List; +import java.util.Map; + +/** + * 系统配置-设备类型设置 控制器 + * + * @author BladeX + * @since 2022-03-03 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/devicecategorysettings") +@Api(value = "系统配置-设备类型设置", tags = "系统配置-设备类型设置接口") +public class DeviceCategorySettingsController extends BladeController { + + private final IDeviceCategorySettingsService deviceCategorySettingsService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入deviceCategorySettings id") + public R detail(@PathVariable String id) { + return R.data(deviceCategorySettingsService.getDetailById(id)); + } + + + /** + * 分页 系统配置-设备类型设置 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入deviceCategorySettings") + public R> list(DeviceCategorySettings deviceCategorySettings, Query query) { + IPage pages = deviceCategorySettingsService.page(Condition.getPage(query), Condition.getQueryWrapper(deviceCategorySettings)); + return R.data(pages); + } + + /** + * 自定义分页 系统配置-设备类型设置 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入deviceCategorySettings") + public R> page(DeviceCategorySettingsVO deviceCategorySettings, Query query) { + IPage pages = deviceCategorySettingsService.selectDeviceCategorySettingsPage(Condition.getPage(query), deviceCategorySettings); + return R.data(pages); + } + /** + * 获取树形结构 + * + * @return + */ + @GetMapping("/tree") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "树形结构", notes = "树形结构") + public R> tree(DeviceCategorySettingsDTO deviceCategorySettingsDTO) { + List tree = deviceCategorySettingsService.tree(deviceCategorySettingsDTO); + return R.data(tree); + } + /** + * 懒加载获取部门树形结构 + */ + @GetMapping("/lazy-tree") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "懒加载树形结构", notes = "树形结构") + public R> lazyTree(Long parentId) { + List tree = deviceCategorySettingsService.lazyTree(parentId); + return R.data(tree); + } + + /** + * 懒加载列表 + */ + @GetMapping("/lazy-list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "类型名称", paramType = "query", dataType = "string") + }) + @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) + @ApiOperationSupport(order = 5) + @ApiOperation(value = "懒加载列表", notes = "传入deviceCategorySettings") + public R> lazyList(Long parentId, @ApiIgnore @RequestParam Map deviceCategorySettings) { + List list = deviceCategorySettingsService.lazyList(parentId, deviceCategorySettings); + return R.data(DCWrapper.build().listNodeLazyVO(list)); + } + + + /** + * 新增或修改 系统配置-设备类型设置 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入deviceCategorySettings") + public R save(@Valid @RequestBody DeviceCategorySettingsDTO deviceCategorySettings) throws ParseException { + return R.status(deviceCategorySettingsService.saveDeviceCategorySettings(deviceCategorySettings)); + } + + + /** + * 删除 系统配置-设备类型设置 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) throws ParseException{ + return deviceCategorySettingsService.removeDeviceCategory(Func.toLongList(ids)); + } + + /** + * 联级选择器树形结构 + *create:qx + * @return + */ + @GetMapping("/cascade") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "树形结构", notes = "树形结构") + public R> cascadeSelection() { + List list = deviceCategorySettingsService.cascadeSelection(); + return R.data(list); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/controller/DeviceInspectionSettingsController.java b/security-service/ht-security/src/main/java/org/security/trans/settings/controller/DeviceInspectionSettingsController.java new file mode 100644 index 0000000..e023d43 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/controller/DeviceInspectionSettingsController.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.settings.dto.DeviceInspectionSettingsDTO; +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.vo.DeviceCategorySettingsVO; +import org.security.trans.task.dto.TaskHandinDTO; +import org.security.trans.task.vo.TaskHandinVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.settings.entity.DeviceInspectionSettings; +import org.security.trans.settings.vo.DeviceInspectionSettingsVO; +import org.security.trans.settings.service.IDeviceInspectionSettingsService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.math.BigDecimal; + +/** + * 系统配置-设备检查项设置 控制器 + * + * @author BladeX + * @since 2022-03-03 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/deviceinspectionsettings") +@Api(value = "系统配置-设备检查项设置", tags = "系统配置-设备检查项设置接口") +public class DeviceInspectionSettingsController extends BladeController { + + private final IDeviceInspectionSettingsService deviceInspectionSettingsService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入deviceInspectionSettings id") + public R detail(@PathVariable BigDecimal id) { + DeviceInspectionSettings detail = deviceInspectionSettingsService.getById(id); + DeviceInspectionSettingsVO deviceInspectionSettingsVO = new DeviceInspectionSettingsVO(); + BeanUtils.copyProperties(detail,deviceInspectionSettingsVO); + return R.data(deviceInspectionSettingsVO); + } + /** + * 分页 系统配置-设备检查项设置 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入deviceInspectionSettings") + public R> list(DeviceInspectionSettings deviceInspectionSettings, Query query) { + IPage pages = deviceInspectionSettingsService.page(Condition.getPage(query), Condition.getQueryWrapper(deviceInspectionSettings)); + return R.data(pages); + } + + /** + * 自定义分页 系统配置-设备检查项设置 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入deviceInspectionSettings") + public R> page(DeviceInspectionSettingsDTO deviceInspectionSettings, Query query) { + IPage pages = deviceInspectionSettingsService.selectDeviceInspectionSettingsPage(Condition.getPage(query), deviceInspectionSettings); + return R.data(pages); + } + + + /** + * 新增 系统配置-设备检查项设置 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入deviceInspectionSettings") + public R save(@Valid @RequestBody DeviceInspectionSettings deviceInspectionSettings) { + return R.status(deviceInspectionSettingsService.save(deviceInspectionSettings)); + } + + /** + * 修改 系统配置-设备检查项设置 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入deviceInspectionSettings") + public R update(@Valid @RequestBody DeviceInspectionSettings deviceInspectionSettings) { + return R.status(deviceInspectionSettingsService.updateById(deviceInspectionSettings)); + } + + /** + * 新增或修改 系统配置-设备检查项设置 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入deviceInspectionSettings") + public R submit(@Valid @RequestBody DeviceInspectionSettings deviceInspectionSettings) { + return R.status(deviceInspectionSettingsService.saveOrUpdate(deviceInspectionSettings)); + } + + + /** + * 删除 系统配置-设备检查项设置 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(deviceInspectionSettingsService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/controller/FileTemplateController.java b/security-service/ht-security/src/main/java/org/security/trans/settings/controller/FileTemplateController.java new file mode 100644 index 0000000..33b1ee9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/controller/FileTemplateController.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.security.trans.settings.dto.FileTemplateDTO; +import org.security.trans.settings.entity.FileTemplate; +import org.security.trans.settings.service.IFileTemplateService; +import org.security.trans.settings.vo.FileTemplateVO; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.math.BigDecimal; +import java.text.ParseException; + +/** + * 文件模板 控制器 + * + * @author BladeX + * @since 2022-03-03 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/filetemplate") +@Api(value = "文件模板", tags = "文件模板接口") +public class FileTemplateController extends BladeController { + + private final IFileTemplateService fileTemplateService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入fileTemplate id") + public R detail(@PathVariable String id) { + return R.data(fileTemplateService.getDetail(id)); + } + + /** + * 分页 文件模板 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入fileTemplate") + public R> list(FileTemplate fileTemplate, Query query) { + IPage pages = fileTemplateService.page(Condition.getPage(query), Condition.getQueryWrapper(fileTemplate)); + return R.data(pages); + } + + /** + * 自定义分页 文件模板 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入fileTemplate") + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + public R> page(FileTemplateVO fileTemplate, Query query) { + IPage pages = fileTemplateService.selectFileTemplatePage(Condition.getPage(query), fileTemplate); + return R.data(pages); + } + + /** + * 新增 文件模板 + */ + @PostMapping("/saveOrUpdate") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入fileTemplate") + public R save(@Valid @RequestBody FileTemplateVO fileTemplate) throws ParseException { + return R.status(fileTemplateService.saveOrUpdateFileTemplate(fileTemplate)); + } + + +// /** +// * 新增 文件模板 +// */ +// @PostMapping("/save") +// @ApiOperationSupport(order = 4) +// @ApiOperation(value = "新增", notes = "传入fileTemplate") +// public R save(@Valid @RequestBody FileTemplateVO fileTemplate) throws ParseException { +// return R.status(fileTemplateService.saveFileTemplate(fileTemplate)); +// } +// +// /** +// * 修改 文件模板 +// */ +// @PostMapping("/update") +// @ApiOperationSupport(order = 5) +// @ApiOperation(value = "修改", notes = "传入fileTemplate") +// public R update(@Valid @RequestBody FileTemplate fileTemplate) { +// return R.status(fileTemplateService.updateById(fileTemplate)); +// } +// + + /** + * 删除 文件模板 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(fileTemplateService.removeByIds(Func.toLongList(ids))); + } + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/dto/BusinessTypeDTO.java b/security-service/ht-security/src/main/java/org/security/trans/settings/dto/BusinessTypeDTO.java new file mode 100644 index 0000000..662772d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/dto/BusinessTypeDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.dto; + +import org.security.trans.settings.entity.BusinessType; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 公共-业务具体类型数据传输对象实体类 + * + * @author BladeX + * @since 2022-04-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class BusinessTypeDTO extends BusinessType { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/dto/DeviceCategorySettingsDTO.java b/security-service/ht-security/src/main/java/org/security/trans/settings/dto/DeviceCategorySettingsDTO.java new file mode 100644 index 0000000..1f561cb --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/dto/DeviceCategorySettingsDTO.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.dto; + +import org.security.trans.settings.entity.DeviceCategorySettings; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.settings.entity.DeviceInspectionSettings; + +import java.util.List; + +/** + * 系统配置-设备类型设置数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DeviceCategorySettingsDTO extends DeviceCategorySettings { + private static final long serialVersionUID = 1L; + + List deviceInspectionList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/dto/DeviceInspectionSettingsDTO.java b/security-service/ht-security/src/main/java/org/security/trans/settings/dto/DeviceInspectionSettingsDTO.java new file mode 100644 index 0000000..d6af04f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/dto/DeviceInspectionSettingsDTO.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.dto; + +import org.security.trans.settings.entity.DeviceInspectionSettings; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 系统配置-设备检查项设置数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DeviceInspectionSettingsDTO extends DeviceInspectionSettings { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/dto/FileTemplateDTO.java b/security-service/ht-security/src/main/java/org/security/trans/settings/dto/FileTemplateDTO.java new file mode 100644 index 0000000..b2b2e14 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/dto/FileTemplateDTO.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.dto; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.settings.entity.FileTemplate; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 文件模板数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class FileTemplateDTO extends FileTemplate { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "模板附件list") + private List fileList; + + @ApiModelProperty(value = "说明附件list") + private List noteFileList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/entity/BusinessType.java b/security-service/ht-security/src/main/java/org/security/trans/settings/entity/BusinessType.java new file mode 100644 index 0000000..1079c7e --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/entity/BusinessType.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.entity; + +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 公共-业务具体类型实体类 + * + * @author BladeX + * @since 2022-04-01 + */ +@Data +@TableName("T_BUSINESS_TYPE") +@ApiModel(value = "BusinessType对象", description = "公共-业务具体类型") +public class BusinessType extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 编码 + */ + @ApiModelProperty(value = "编码") + @TableField("CODE") + private String code; + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @TableField("NAME") + private String name; + /** + * 类别;1-日常任务 2-专项任务 + */ + @ApiModelProperty(value = "类别;1-日常任务 2-专项任务") + @TableField("TYPE") + private String type; + /** + * 所属任务模块 + */ + @ApiModelProperty(value = "所属任务模块") + @TableField("MODULE") + private String module; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 可作为任务下发; 0-否, 1-是 + */ + @ApiModelProperty(value = "可作为任务下发; 0-否, 1-是") + @TableField("AS_TASK") + private String asTask; + /** + * 备用字段2 + */ + @ApiModelProperty(value = "备用字段2") + @TableField("RESERVE2") + private String reserve2; + /** + * 备用字段3 + */ + @ApiModelProperty(value = "备用字段3") + @TableField("RESERVE3") + private String reserve3; + /** + * 备用字段4 + */ + @ApiModelProperty(value = "备用字段4") + @TableField("RESERVE4") + private String reserve4; + /** + * 备用字段5 + */ + @ApiModelProperty(value = "备用字段5") + @TableField("RESERVE5") + private String reserve5; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/entity/DeviceCategorySettings.java b/security-service/ht-security/src/main/java/org/security/trans/settings/entity/DeviceCategorySettings.java new file mode 100644 index 0000000..ba92bc6 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/entity/DeviceCategorySettings.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.entity.common.BaseEntity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 系统配置-设备类型设置实体类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Data +@TableName("T_DEVICE_CATEGORY_SETTINGS") +@ApiModel(value = "DeviceCategorySettings对象", description = "系统配置-设备类型设置") +public class DeviceCategorySettings implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableField("ID") + private Long id; + /** + * 创建人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createdBy; + /** + * 创建时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + private Date createdTime; + /** + * 更新人 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新人") + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updatedBy; + /** + * 更新时间 + */ +// @ExcelIgnore + @ApiModelProperty(value = "更新时间") + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updatedTime; + /** + * 类型名称 + */ + @ApiModelProperty(value = "类型名称") + @TableField("NAME") + private String name; + /** + * 父类ID + */ + @ApiModelProperty(value = "父类ID") + @TableField("PARENT_ID") + private Long parentId; + /** + * 状态;1-可用 0-停用 + */ + @ApiModelProperty(value = "状态;1-可用 0-停用") + @TableField("STATE") + private BigDecimal state; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 父类id串,用于前端级联显示 + */ + @ApiModelProperty(value = "父类id串;用于前端级联显示") + @TableField("RESERVE1") + private String reserve1; + /** + * 设备维保提醒提前天数(单位:天) + */ + @ApiModelProperty(value = "设备维保提醒提前天数(单位:天)") + @TableField("remind_day") + private int remindDay; + + /** + *检查频次 + */ + @ApiModelProperty(value = "检查频次") + @TableField("CHECK_FREQ") + private String checkFreq; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/entity/DeviceInspectionSettings.java b/security-service/ht-security/src/main/java/org/security/trans/settings/entity/DeviceInspectionSettings.java new file mode 100644 index 0000000..2d350f4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/entity/DeviceInspectionSettings.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.*; + +import java.io.Serializable; + +import lombok.Data; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.entity.common.BaseEntity; + +/** + * 系统配置-设备检查项设置实体类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Data +@TableName("T_DEVICE_INSPECTION_SETTINGS") +@ApiModel(value = "DeviceInspectionSettings对象", description = "系统配置-设备检查项设置") +public class DeviceInspectionSettings extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 名称 + */ + @ApiModelProperty(value = "名称") + @TableField("NAME") + private String name; + /** + * 设备类型ID + */ + @ApiModelProperty(value = "设备类型ID") + @TableField("DEVICE_CATG_ID") + private String deviceCatgId; + /** + * 填报类型 + */ + @ApiModelProperty(value = "填报类型") + @TableField("TYPE") + private String type; + /** + * 状态;1-可用 0-停用 + */ + @ApiModelProperty(value = "状态;1-可用 0-停用") + @TableField("STATE") + private BigDecimal state; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;1-删除,0-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 备用字段1 + */ + @ApiModelProperty(value = "备用字段1") + @TableField("RESERVE1") + private String reserve1; + /** + * 备用字段2 + */ + @ApiModelProperty(value = "备用字段2") + @TableField("RESERVE2") + private String reserve2; + /** + * 备用字段3 + */ + @ApiModelProperty(value = "备用字段3") + @TableField("RESERVE3") + private String reserve3; + /** + * 备用字段4 + */ + @ApiModelProperty(value = "备用字段4") + @TableField("RESERVE4") + private String reserve4; + /** + * 备用字段5 + */ + @ApiModelProperty(value = "备用字段5") + @TableField("RESERVE5") + private String reserve5; + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/entity/FileTemplate.java b/security-service/ht-security/src/main/java/org/security/trans/settings/entity/FileTemplate.java new file mode 100644 index 0000000..dd83440 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/entity/FileTemplate.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.entity.common.BaseEntity; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 文件模板实体类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Data +@TableName("T_FILE_TEMPLATE") +@ApiModel(value = "FileTemplate对象", description = "文件模板") +public class FileTemplate extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 模板名称 + */ + @ApiModelProperty(value = "模板名称") + @TableField("NAME") + private String name; + /** + * 模板说明 + */ + @ApiModelProperty(value = "模板说明") + @TableField("NOTE") + private String note; + /** + * 文件ID + */ + @ApiModelProperty(value = "文件ID") + @TableField("FILE_ID") + private String fileId; + /** + * 说明文件 + */ + @ApiModelProperty(value = "说明文件") + @TableField("NOTE_FILE") + private String noteFile; + /** + * 状态;1-可用 0-弃用 + */ + @ApiModelProperty(value = "状态;1-可用 0-弃用") + @TableField("STATE") + private BigDecimal state; + /** + * 任务ID + */ + @ApiModelProperty(value = "任务ID") + @TableField("TASK_ID") + private String taskId; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;1-删除,0-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + + @TableField("DEPT_ID") + private String deptId; + /** + * 模板附件groupName + */ + + @ApiModelProperty(value = "模板附件groupName") + @TableField("GROUP_NAME") + private String groupName; + /** + * 其他附件groupName + */ + + @ApiModelProperty(value = "附件groupName") + @TableField("OTHER_GROUP_NAME") + private String otherGroupName; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/BusinessTypeMapper.java b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/BusinessTypeMapper.java new file mode 100644 index 0000000..5ae2519 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/BusinessTypeMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.mapper; + +import org.security.trans.settings.entity.BusinessType; +import org.security.trans.settings.vo.BusinessTypeVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 公共-业务具体类型 Mapper 接口 + * + * @author BladeX + * @since 2022-04-01 + */ +public interface BusinessTypeMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param businessType + * @return + */ + List selectBusinessTypePage(IPage page, BusinessTypeVO businessType); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/BusinessTypeMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/BusinessTypeMapper.xml new file mode 100644 index 0000000..ce6f550 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/BusinessTypeMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceCategorySettingsMapper.java b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceCategorySettingsMapper.java new file mode 100644 index 0000000..888895b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceCategorySettingsMapper.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.security.ht.entity.basic.Device; +import org.security.trans.settings.dto.DeviceCategorySettingsDTO; +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.vo.DeviceCategorySettingsVO; + +import java.util.List; +import java.util.Map; + +/** + * 系统配置-设备类型设置 Mapper 接口 + * + * @author BladeX + * @since 2022-03-03 + */ +public interface DeviceCategorySettingsMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param deviceCategorySettings + * @return + */ + List selectDeviceCategorySettingsPage(IPage page, DeviceCategorySettingsVO deviceCategorySettings); + + /** + * 获取树形节点 + * + * @param + * @return + */ + List tree(@Param("deviceCategorySettingsDTO") DeviceCategorySettingsDTO deviceCategorySettingsDTO); + + List cascade(); + + List lazyTree(Long parentId); + + List getListCgByName(String cname); + + /** + * 懒加载列表 + * + * @param parentId + * @param param + * @return + */ + List lazyList(Long parentId, Map param); + + void updateDeviceFrequence(@Param("id") String id,@Param("checkFreq") String checkFreq); + + /** + * 查询设备类型下未删除的设备 + * + * @param typeId + * @return + */ + List deviceList(@Param("typeId") String typeId); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceCategorySettingsMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceCategorySettingsMapper.xml new file mode 100644 index 0000000..6c95105 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceCategorySettingsMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceInspectionSettingsMapper.java b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceInspectionSettingsMapper.java new file mode 100644 index 0000000..0e08fb7 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceInspectionSettingsMapper.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.mapper; + +import org.security.trans.settings.entity.DeviceInspectionSettings; +import org.security.trans.settings.vo.DeviceInspectionSettingsVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 系统配置-设备检查项设置 Mapper 接口 + * + * @author BladeX + * @since 2022-03-03 + */ +public interface DeviceInspectionSettingsMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param deviceInspectionSettings + * @return + */ + List selectDeviceInspectionSettingsPage(IPage page, DeviceInspectionSettingsVO deviceInspectionSettings); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceInspectionSettingsMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceInspectionSettingsMapper.xml new file mode 100644 index 0000000..d4e5652 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/DeviceInspectionSettingsMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/FileTemplateMapper.java b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/FileTemplateMapper.java new file mode 100644 index 0000000..fa4f38b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/FileTemplateMapper.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.mapper; + +import feign.Param; +import org.security.trans.settings.entity.FileTemplate; +import org.security.trans.settings.vo.FileTemplateVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * 文件模板 Mapper 接口 + * + * @author BladeX + * @since 2022-03-03 + */ +public interface FileTemplateMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param fileTemplate + * @return + */ + List selectFileTemplatePage(IPage page, @Param("fileTemplate") FileTemplateVO fileTemplate); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/FileTemplateMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/FileTemplateMapper.xml new file mode 100644 index 0000000..4f92c60 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/mapper/FileTemplateMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/service/IBusinessTypeService.java b/security-service/ht-security/src/main/java/org/security/trans/settings/service/IBusinessTypeService.java new file mode 100644 index 0000000..b7d2998 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/service/IBusinessTypeService.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.service; + +import org.security.trans.settings.dto.BusinessTypeDTO; +import org.security.trans.settings.entity.BusinessType; +import org.security.trans.settings.vo.BusinessTypeVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + + +import java.text.ParseException; + +/** + * 公共-业务具体类型 服务类 + * + * @author BladeX + * @since 2022-04-01 + */ +public interface IBusinessTypeService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param businessType + * @return + */ + IPage selectBusinessTypePage(IPage page, BusinessTypeVO businessType); + + /** + * 新增业务类型 + * + * @param businessType + * @return + */ + boolean saveBusinessType(BusinessTypeDTO businessType) throws ParseException; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/service/IDeviceCategorySettingsService.java b/security-service/ht-security/src/main/java/org/security/trans/settings/service/IDeviceCategorySettingsService.java new file mode 100644 index 0000000..acf28d5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/service/IDeviceCategorySettingsService.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.trans.settings.dto.DeviceCategorySettingsDTO; +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.vo.DeviceCategorySettingsVO; +import org.springblade.core.tool.api.R; + +import java.text.ParseException; +import java.util.List; +import java.util.Map; + +/** + * 系统配置-设备类型设置 服务类 + * + * @author BladeX + * @since 2022-03-03 + */ +public interface IDeviceCategorySettingsService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param deviceCategorySettings + * @return + */ + IPage selectDeviceCategorySettingsPage(IPage page, DeviceCategorySettingsVO deviceCategorySettings); + + /** + * 新增或修改 + * + * @param deviceCategorySettings + * @return + */ + boolean saveDeviceCategorySettings(DeviceCategorySettingsDTO deviceCategorySettings) throws ParseException; + + /** + * 查询树形数据 + * + * @param + * @return + */ + List tree(DeviceCategorySettingsDTO deviceCategorySettingsDTO); + + /** + * 懒加载树形结构 + * + * @param parentId + * @return + */ + List lazyTree(Long parentId); + /** + * 懒加载列表 + * + * @param parentId + * @param param + * @return + */ + List lazyList(Long parentId, Map param); + + List cascadeSelection(); + + DeviceCategorySettingsVO getDetailById(String id); + /** + * 自定义删除 + * + * @param toLongList + * @return + */ + R removeDeviceCategory(List toLongList) throws ParseException; + /** + * 根据类型名称查询设备类型详情 + * + * @param cname + * @return + */ + List getCgListByName(String cname); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/service/IDeviceInspectionSettingsService.java b/security-service/ht-security/src/main/java/org/security/trans/settings/service/IDeviceInspectionSettingsService.java new file mode 100644 index 0000000..ee10be5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/service/IDeviceInspectionSettingsService.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.service; + +import org.security.trans.settings.dto.DeviceInspectionSettingsDTO; +import org.security.trans.settings.entity.DeviceInspectionSettings; +import org.security.trans.settings.vo.DeviceInspectionSettingsVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +/** + * 系统配置-设备检查项设置 服务类 + * + * @author BladeX + * @since 2022-03-03 + */ +public interface IDeviceInspectionSettingsService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param deviceInspectionSettings + * @return + */ + IPage selectDeviceInspectionSettingsPage(IPage page, DeviceInspectionSettingsDTO deviceInspectionSettings); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/service/IFileTemplateService.java b/security-service/ht-security/src/main/java/org/security/trans/settings/service/IFileTemplateService.java new file mode 100644 index 0000000..1fd48e1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/service/IFileTemplateService.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.service; + +import org.security.trans.settings.entity.FileTemplate; +import org.security.trans.settings.vo.FileTemplateVO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.math.BigDecimal; +import java.text.ParseException; + +/** + * 文件模板 服务类 + * + * @author BladeX + * @since 2022-03-03 + */ +public interface IFileTemplateService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param fileTemplate + * @return + */ + IPage selectFileTemplatePage(IPage page, FileTemplateVO fileTemplate); + + /** + * 新增文件模板 + * + * @param fileTemplate + * @return + */ + boolean saveOrUpdateFileTemplate(FileTemplateVO fileTemplate) throws ParseException; + /** + * 查询详情 + * + * @param id + * @return + */ + FileTemplateVO getDetail(String id); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/BusinessTypeServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/BusinessTypeServiceImpl.java new file mode 100644 index 0000000..78eed13 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/BusinessTypeServiceImpl.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.service.impl; + +import org.security.common.util.DataFormatUtil; +import org.security.trans.settings.dto.BusinessTypeDTO; +import org.security.trans.settings.entity.BusinessType; +import org.security.trans.settings.vo.BusinessTypeVO; +import org.security.trans.settings.mapper.BusinessTypeMapper; +import org.security.trans.settings.service.IBusinessTypeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.secure.utils.AuthUtil; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.text.ParseException; + +/** + * 公共-业务具体类型 服务实现类 + * + * @author BladeX + * @since 2022-04-01 + */ +@Service +public class BusinessTypeServiceImpl extends ServiceImpl implements IBusinessTypeService { + + @Override + public IPage selectBusinessTypePage(IPage page, BusinessTypeVO businessType) { + return page.setRecords(baseMapper.selectBusinessTypePage(page, businessType)); + } + + @Override + public boolean saveBusinessType(BusinessTypeDTO businessType) throws ParseException { + businessType.setCreatedBy(String.valueOf(AuthUtil.getUserId())); + businessType.setCreatedTime(DataFormatUtil.getNowDate()); + return super.save(businessType); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/DeviceCategorySettingsServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/DeviceCategorySettingsServiceImpl.java new file mode 100644 index 0000000..1b10e06 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/DeviceCategorySettingsServiceImpl.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.ht.entity.basic.Device; +import org.security.trans.settings.dto.DeviceCategorySettingsDTO; +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.entity.DeviceInspectionSettings; +import org.security.trans.settings.service.IDeviceInspectionSettingsService; +import org.security.trans.settings.vo.DeviceCategorySettingsVO; +import org.security.trans.settings.mapper.DeviceCategorySettingsMapper; +import org.security.trans.settings.service.IDeviceCategorySettingsService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.node.ForestNodeMerger; +import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springframework.transaction.annotation.Transactional; + +import java.text.ParseException; +import java.util.List; +import java.util.Map; + +/** + * 系统配置-设备类型设置 服务实现类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Service +@Slf4j +@AllArgsConstructor +public class DeviceCategorySettingsServiceImpl extends ServiceImpl implements IDeviceCategorySettingsService { + private final static String PARENT_ID = "parentId"; + private final IDeviceInspectionSettingsService deviceInspectionSettingsService; + + + @Override + public IPage selectDeviceCategorySettingsPage(IPage page, DeviceCategorySettingsVO deviceCategorySettings) { + return page.setRecords(baseMapper.selectDeviceCategorySettingsPage(page, deviceCategorySettings)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveDeviceCategorySettings(DeviceCategorySettingsDTO deviceCategorySettingsDTO) throws ParseException { + DeviceCategorySettings deviceCategorySettings = Func.copy(deviceCategorySettingsDTO,DeviceCategorySettings.class); +// 如果是新增的设备类型,要检查是否重名,重名不允许新增 + if(Func.isEmpty(deviceCategorySettings.getId())){ + List nowDcs = baseMapper.getListCgByName(deviceCategorySettings.getName()); + if (nowDcs.size()>0){ + throw new ServiceException("当前设备类型名称已存在,请勿重复添加!"); + } + } + if(deviceCategorySettings.getParentId() == null || deviceCategorySettings.getParentId().longValue() == 0){ + deviceCategorySettings.setParentId(new Long(0)); + } + deviceCategorySettings.setDelFlag(Constant.DELETE_FLAG_0); + super.saveOrUpdate(deviceCategorySettings); + List lineList = deviceCategorySettingsDTO.getDeviceInspectionList(); + if (Func.isNotEmpty(lineList)){ + lineList.forEach(item -> { + item.setDeviceCatgId(deviceCategorySettings.getId().toString()); + }); + //更新明细表-设备检查项-数据 + deviceInspectionSettingsService.saveOrUpdateBatch(lineList); + } + this.saveOrUpdate(deviceCategorySettings); + //更新设备表的检查频率 + if (Func.isNotEmpty(deviceCategorySettings.getCheckFreq())){ + baseMapper.updateDeviceFrequence(String.valueOf(deviceCategorySettings.getId()),deviceCategorySettings.getCheckFreq()); + } + return true; + } + + @Override + public List tree(DeviceCategorySettingsDTO deviceCategorySettingsDTO) { + return ForestNodeMerger.merge(baseMapper.tree(deviceCategorySettingsDTO)); + } + + @Override + public List lazyTree(Long parentId) { + return ForestNodeMerger.merge(baseMapper.lazyTree(parentId)); + } + + @Override + public List lazyList(Long parentId, Map param) { + if (Func.isEmpty(Func.toStr(param.get(PARENT_ID)))) { + parentId = null; + } + return baseMapper.lazyList(parentId, param); + } + @Override + public List getCgListByName(String cname) { + return baseMapper.getListCgByName(cname); + } + + @Override + public List cascadeSelection() { + List deviceCategorySettingsVOS = baseMapper.cascade(); + return ForestNodeMerger.merge(deviceCategorySettingsVOS); + } + + @Override + public DeviceCategorySettingsVO getDetailById(String id){ + DeviceCategorySettings deviceCategorySettings =super.getById(id); + DeviceCategorySettingsVO deviceCategorySettingsVO = Func.copy(deviceCategorySettings,DeviceCategorySettingsVO.class); + //获取明细信息 + List lineList = deviceInspectionSettingsService.list(new QueryWrapper().eq("DEVICE_CATG_ID", id)); + if(Func.isNotEmpty(lineList)){ + deviceCategorySettingsVO.setDeviceInspectionList(lineList); + } + return deviceCategorySettingsVO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R removeDeviceCategory(List toLongList){ + toLongList.forEach(ele -> { + String item = String.valueOf(ele); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DeviceCategorySettings::getParentId, item).eq(DeviceCategorySettings::getDelFlag, Constant.DELETE_FLAG_0); + List dcList = this.baseMapper.selectList(queryWrapper); + if(dcList.size()>0){ + log.info("=====设备类型【{}】存在使用中的子级类型,无法删除",item); + throw new ServiceException("当前设备类型存在使用中的子级类型,无法删除"); + } + List deviceList = this.baseMapper.deviceList(item); + if(deviceList.size()>0){ + log.info("=====设备类型【{}】存在使用中的设备,无法删除",item); + throw new ServiceException("当前设备类型存在使用中的设备,无法删除"); + } + }); + return R.status(this.removeByIds(toLongList)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/DeviceInspectionSettingsServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/DeviceInspectionSettingsServiceImpl.java new file mode 100644 index 0000000..97dd3ef --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/DeviceInspectionSettingsServiceImpl.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.commons.lang.StringUtils; +import org.security.trans.settings.dto.DeviceInspectionSettingsDTO; +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.entity.DeviceInspectionSettings; +import org.security.trans.settings.service.IDeviceCategorySettingsService; +import org.security.trans.settings.vo.DeviceInspectionSettingsVO; +import org.security.trans.settings.mapper.DeviceInspectionSettingsMapper; +import org.security.trans.settings.service.IDeviceInspectionSettingsService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.ArrayList; +import java.util.List; + +/** + * 系统配置-设备检查项设置 服务实现类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Service +public class DeviceInspectionSettingsServiceImpl extends ServiceImpl implements IDeviceInspectionSettingsService { +// @Autowired +// private IDeviceCategorySettingsService deviceCategorySettingsService; + + @Override + public IPage selectDeviceInspectionSettingsPage(IPage page, DeviceInspectionSettingsDTO deviceInspectionSettingsDTO) { + Page deviceInspectionSettingsPage = new Page<>(page.getCurrent(), page.getSize()); + LambdaQueryWrapper dpsLambdaQueryWrapper = new QueryWrapper().lambda() + .eq(StringUtils.isNotBlank(deviceInspectionSettingsDTO.getDeviceCatgId()), DeviceInspectionSettings::getDeviceCatgId, deviceInspectionSettingsDTO.getDeviceCatgId()) + .like(StringUtils.isNotBlank(deviceInspectionSettingsDTO.getName()), DeviceInspectionSettings::getName, deviceInspectionSettingsDTO.getName()) + .eq(StringUtils.isNotBlank(deviceInspectionSettingsDTO.getType()), DeviceInspectionSettings::getType, deviceInspectionSettingsDTO.getType()); + + Page resultPage = this.page(deviceInspectionSettingsPage, dpsLambdaQueryWrapper); + List DPSList = resultPage.getRecords(); + List dpsVOList = new ArrayList<>(); + DPSList.forEach(item -> { +// DeviceCategorySettings deviceCategorySettings = deviceCategorySettingsService.getOne(new QueryWrapper().lambda().eq(DeviceCategorySettings::getId, item.getDeviceCatgId())); + DeviceInspectionSettingsVO deviceInspectionSettingsVO = Func.copy(item, DeviceInspectionSettingsVO.class); + assert deviceInspectionSettingsVO != null; +// deviceInspectionSettingsVO.setDcName(Func.isNotEmpty(deviceCategorySettings)?deviceCategorySettings.getName():""); + dpsVOList.add(deviceInspectionSettingsVO); + }); + return new Page() + .setRecords(dpsVOList) + .setTotal(resultPage.getTotal()) + .setSize(resultPage.getSize()) + .setCurrent(resultPage.getCurrent()); } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/FileTemplateServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/FileTemplateServiceImpl.java new file mode 100644 index 0000000..4cc2b06 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/service/impl/FileTemplateServiceImpl.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.util.DataFormatUtil; +import org.security.trans.common.service.IFileService; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.settings.entity.FileTemplate; +import org.security.trans.settings.mapper.FileTemplateMapper; +import org.security.trans.settings.service.IFileTemplateService; +import org.security.trans.settings.vo.FileTemplateVO; +import org.springblade.core.secure.utils.AuthUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.text.ParseException; +import java.util.List; +import java.util.Objects; + +/** + * 文件模板 服务实现类 + * + * @author BladeX + * @since 2022-03-03 + */ +@AllArgsConstructor +@Service +@Slf4j +public class FileTemplateServiceImpl extends ServiceImpl implements IFileTemplateService { + + private final IFileService fileService; + + @Override + public IPage selectFileTemplatePage(IPage page, FileTemplateVO fileTemplate) { + List vos = baseMapper.selectFileTemplatePage(page,fileTemplate); + if(vos.size()>0){ + vos.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + return page.setRecords(vos); + } + + @Override + public boolean saveOrUpdateFileTemplate(FileTemplateVO fileTemplate) throws ParseException { + fileTemplate.setDelFlag(Constant.DELETE_FLAG_0); + fileTemplate.setCreatedBy(String.valueOf(AuthUtil.getUserId())); + fileTemplate.setCreatedTime(DataFormatUtil.getNowDate()); + fileTemplate.setDeptId(AuthUtil.getDeptId()); + this.saveOrUpdate(fileTemplate); + // 存模板附件 + List fileList = fileTemplate.getFileList(); + if(Objects.nonNull(fileList) && !fileList.isEmpty()){ + fileService.saveAttachments(fileList, fileTemplate.getId()); + } + // 存说明附件 + List noteFileList = fileTemplate.getNoteFileList(); + if (Objects.nonNull(noteFileList) && !noteFileList.isEmpty()) { + fileService.saveAttachments(noteFileList, fileTemplate.getId()); + } + return true; + } + + @Override + public FileTemplateVO getDetail(String id) { + FileTemplate detail = super.getById(id); + FileTemplateVO fileTemplateVO = new FileTemplateVO(); + BeanUtils.copyProperties(detail, fileTemplateVO); + fileTemplateVO.setFileList(fileService.getAttachments(detail.getId(),detail.getGroupName())); + fileTemplateVO.setNoteFileList(fileService.getAttachments(detail.getId(),detail.getOtherGroupName())); + return fileTemplateVO; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/vo/BusinessTypeVO.java b/security-service/ht-security/src/main/java/org/security/trans/settings/vo/BusinessTypeVO.java new file mode 100644 index 0000000..ac21f72 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/vo/BusinessTypeVO.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.vo; + +import org.security.trans.settings.entity.BusinessType; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 公共-业务具体类型视图实体类 + * + * @author BladeX + * @since 2022-04-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "BusinessTypeVO对象", description = "公共-业务具体类型") +public class BusinessTypeVO extends BusinessType { + private static final long serialVersionUID = 1L; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/vo/DeviceCategorySettingsVO.java b/security-service/ht-security/src/main/java/org/security/trans/settings/vo/DeviceCategorySettingsVO.java new file mode 100644 index 0000000..34b880a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/vo/DeviceCategorySettingsVO.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.vo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import org.security.trans.settings.entity.DeviceCategorySettings; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.security.trans.settings.entity.DeviceInspectionSettings; +import org.springblade.core.tool.node.INode; + +import java.util.ArrayList; +import java.util.List; + +/** + * 系统配置-设备类型设置视图实体类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "DeviceCategorySettingsVO对象", description = "系统配置-设备类型设置") +public class DeviceCategorySettingsVO extends DeviceCategorySettings implements INode { + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + /** + * 父节点ID + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long parentId; + + /** + * 子孙节点 + */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + + /** + * 是否有子孙节点 + */ + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private Boolean hasChildren; + + @Override + public List getChildren() { + if (this.children == null) { + this.children = new ArrayList<>(); + } + return this.children; + } + + /** + * 上级类型名称 + */ + private String parentName; + + List deviceInspectionList; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/vo/DeviceInspectionSettingsVO.java b/security-service/ht-security/src/main/java/org/security/trans/settings/vo/DeviceInspectionSettingsVO.java new file mode 100644 index 0000000..b0ffb44 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/vo/DeviceInspectionSettingsVO.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.vo; + +import org.security.trans.settings.entity.DeviceInspectionSettings; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * 系统配置-设备检查项设置视图实体类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "DeviceInspectionSettingsVO对象", description = "系统配置-设备检查项设置") +public class DeviceInspectionSettingsVO extends DeviceInspectionSettings { + private static final long serialVersionUID = 1L; +// 设备类型名称 + private String dcName; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/vo/FileTemplateVO.java b/security-service/ht-security/src/main/java/org/security/trans/settings/vo/FileTemplateVO.java new file mode 100644 index 0000000..8583554 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/vo/FileTemplateVO.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.settings.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.settings.entity.FileTemplate; + +import java.util.List; + +/** + * 文件模板视图实体类 + * + * @author BladeX + * @since 2022-03-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "FileTemplateVO对象", description = "文件模板") +public class FileTemplateVO extends FileTemplate { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "模板附件list") + private List fileList; + + @ApiModelProperty(value = "说明附件list") + private List noteFileList; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/settings/wrapper/DCWrapper.java b/security-service/ht-security/src/main/java/org/security/trans/settings/wrapper/DCWrapper.java new file mode 100644 index 0000000..1fdf5b1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/settings/wrapper/DCWrapper.java @@ -0,0 +1,42 @@ +package org.security.trans.settings.wrapper; + +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.vo.DeviceCategorySettingsVO; +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.constant.BladeConstant; +import org.springblade.core.tool.node.ForestNodeMerger; +import org.springblade.core.tool.utils.BeanUtil; + +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + + +public class DCWrapper extends BaseEntityWrapper{ + + public static DCWrapper build() { + return new DCWrapper(); + } + @Override + public DeviceCategorySettingsVO entityVO(DeviceCategorySettings deviceCategorySettings) { + DeviceCategorySettingsVO deviceCategorySettingsVO = Objects.requireNonNull(BeanUtil.copy(deviceCategorySettings, DeviceCategorySettingsVO.class)); + if (deviceCategorySettings.getParentId() == null || deviceCategorySettings.getParentId().longValue() == 0) { + deviceCategorySettingsVO.setParentName(BladeConstant.TOP_PARENT_NAME); + } else { +// 查询parentName +// IDeviceCategorySettingsService settingsService; +// String pName = settingsService.getById(deviceCategorySettings.getParentId()).getName(); + deviceCategorySettingsVO.setParentName("pName"); + + } + return deviceCategorySettingsVO; + } + public List listNodeVO(List list) { + List collect = list.stream().map(deviceCategorySettings -> BeanUtil.copy(deviceCategorySettings, DeviceCategorySettingsVO.class)).collect(Collectors.toList()); + return ForestNodeMerger.merge(collect); + } + public List listNodeLazyVO(List list) { + return ForestNodeMerger.merge(list); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/controller/TaskController.java b/security-service/ht-security/src/main/java/org/security/trans/task/controller/TaskController.java new file mode 100644 index 0000000..5b760a5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/controller/TaskController.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.validation.Valid; + +import org.security.trans.task.dto.TaskDTO; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.security.system.entity.Role; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.task.entity.Task; +import org.security.trans.task.vo.TaskVO; +import org.security.trans.task.service.ITaskService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.util.List; + +/** + * 任务-任务下发 控制器 + * + * @author BladeX + * @since 2022-03-10 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/task") +@Api(value = "任务-任务下发", tags = "任务-任务下发接口") +public class TaskController extends BladeController { + + private final ITaskService taskService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + TaskVO detail = taskService.getDetail(id); + return R.data(detail); + } + + /** + * 自定义分页 任务-任务下发 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入task") + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + public R> list(TaskDTO task, Query query) { + IPage pages = taskService.selectTaskPage(Condition.getPage(query), task); + return R.data(pages); + } + + /** + * 暂存 任务-任务下发 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "暂存", notes = "传入task") + public R save(@Valid @RequestBody TaskDTO task) { + return taskService.saveTask(task); + } + + /** + * 删除 任务-任务下发 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(taskService.removeByIds(Func.toLongList(ids))); + } + + /** + * 获取任务提报角色列表 + */ + @GetMapping("/role-list") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "列表") + public R> getRoleList() { + List roles = taskService.getRoleList(); + return R.data(roles); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/controller/TaskHandinController.java b/security-service/ht-security/src/main/java/org/security/trans/task/controller/TaskHandinController.java new file mode 100644 index 0000000..413fa00 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/controller/TaskHandinController.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import javax.validation.Valid; + +import org.security.trans.task.dto.TaskDTO; +import org.security.trans.task.dto.TaskHandinDTO; +import org.security.trans.task.vo.TaskTodoVO; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.security.trans.task.entity.TaskHandin; +import org.security.trans.task.vo.TaskHandinVO; +import org.security.trans.task.service.ITaskHandinService; +import org.springblade.core.boot.ctrl.BladeController; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.List; + +/** + * 任务-任务提报 控制器 + * + * @author BladeX + * @since 2022-03-14 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/taskhandin") +@Api(value = "任务-任务提报", tags = "任务-任务提报接口") +public class TaskHandinController extends BladeController { + + private final ITaskHandinService taskHandinService; + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable BigDecimal id) { + TaskHandinVO detail = taskHandinService.getDetail(id); + return R.data(detail); + } + + /** + * 自定义分页 任务-任务提报 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入taskHandin") + public R> list(TaskHandinDTO taskHandinDTO, Query query) { + IPage pages = taskHandinService.selectTaskHandinPage(Condition.getPage(query), taskHandinDTO); + return R.data(pages); + } + + /** + * 暂存 任务-任务提报 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "暂存", notes = "传入taskHandin") + public R save(@Valid @RequestBody TaskHandinDTO taskHandin){ + return taskHandinService.saveTaskHandin(taskHandin).isSuccess() ? R.success("操作成功") : R.fail("操作失败"); + } + + /** + * 修改 任务-任务提报 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入taskHandin") + public R update(@Valid @RequestBody TaskHandin taskHandin) { + return R.status(taskHandinService.updateTaskHandin(taskHandin)); + } + + /** + * 新增或修改 任务-任务提报 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入taskHandin") + public R submit(@Valid @RequestBody TaskHandinDTO taskHandin) { + return taskHandinService.saveTaskHandin(taskHandin); + } + + + /** + * 提报 任务-任务提报 + */ + @PostMapping("/handin") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "提报", notes = "传入taskHandin") + public R handin(@Valid @RequestBody TaskHandinDTO taskHandin) throws ParseException{ + return taskHandinService.handin(taskHandin); + } + + + /** + * 删除 任务-任务提报 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(taskHandinService.removeByIds(Func.toLongList(ids))); + } + + + + /** + * 发布 任务-任务下发 + * + */ + @PostMapping("/publish") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "发布", notes = "传入task") + public R submit(@Valid @RequestBody TaskDTO task) { + return taskHandinService.publishTask(task); + } + + /** + * 查询待办 + */ + @GetMapping("/todolist") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "列表", notes = "") + public R> todoList() { + List pages = taskHandinService.selectTaskTodo(); + return R.data(pages); + } + + + /** + * 终止任务 + */ + @PostMapping("/endTask") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R endTask(@Valid @RequestBody TaskDTO task) { + return taskHandinService.endTaskByIds(task); + } + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/dto/TaskDTO.java b/security-service/ht-security/src/main/java/org/security/trans/task/dto/TaskDTO.java new file mode 100644 index 0000000..bec6eca --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/dto/TaskDTO.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.dto; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.task.entity.Task; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 任务-任务下发数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class TaskDTO extends Task { + private static final long serialVersionUID = 1L; + private String flowBusinessCode; + + @ApiModelProperty(value = "附件list") + private List fileList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/dto/TaskHandinDTO.java b/security-service/ht-security/src/main/java/org/security/trans/task/dto/TaskHandinDTO.java new file mode 100644 index 0000000..890f594 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/dto/TaskHandinDTO.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.dto; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.task.entity.TaskHandin; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 任务-任务提报数据传输对象实体类 + * + * @author BladeX + * @since 2022-03-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class TaskHandinDTO extends TaskHandin { + private static final long serialVersionUID = 1L; + private String flowBusinessCodes; + + @ApiModelProperty(value = "附件list") + private List fileList; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/entity/Task.java b/security-service/ht-security/src/main/java/org/security/trans/task/entity/Task.java new file mode 100644 index 0000000..670e37b --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/entity/Task.java @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.security.ht.entity.common.BaseEntity; + +import java.io.Serializable; +import java.util.Date; + +/** + * 任务-任务下发实体类 + * + * @author BladeX + * @since 2022-03-10 + */ +@Data +@TableName("T_TASK") +@ApiModel(value = "Task对象", description = "任务-任务下发") +public class Task extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 任务类型;1-日常 2-专项 + */ + @ApiModelProperty(value = "任务类型;1-日常 2-专项") + @TableField("FLAG") + private String flag; + /** + * 任务名称 + */ + @ApiModelProperty(value = "任务名称") + @TableField("NAME") + private String name; + /** + * 任务编号 + */ + @ApiModelProperty(value = "任务编号") + @TableField("NUM") + private String num; + /** + * 所属模块 + */ + @ApiModelProperty(value = "所属模块") + @TableField("MODULE") + private String module; + /** + * 业务类型code + */ + @ApiModelProperty(value = "业务类型code") + @TableField("BUSINESS_TYPE") + private String businessType; + /** + * 概述 + */ + @ApiModelProperty(value = "概述") + @TableField("SUMMARY") + private String summary; + /** + * 提报类型;单次提报/按频次提报 + */ + @ApiModelProperty(value = "提报类型;单次提报/按频次提报") + @TableField("TYPE") + private String type; + /** + * 提报频次(once-仅一次, + * byDay-每天一次, + * byWeek-每周一次, + * byMonth-每月一次, + * byQuarter-每季度一次, + * byHalfYear-每半年一次, + * byYear-每年一次) + */ + @ApiModelProperty(value = "提报频次(once-仅一次,\n" + + "byDay-每天一次,\n" + + "byWeek-每周一次,\n" + + "byMonth-每月一次,\n" + + "byQuarter-每季度一次,\n" + + "byHalfYear-每半年一次,\n" + + "byYear-每年一次)") + @TableField("FREQUENCY") + private String frequency; + /** + * 任务开始时间 + */ + @ApiModelProperty(value = "任务开始时间") + @TableField("BEGIN_DATE") + @JsonFormat(pattern="yyyy-MM-dd") + @JsonSerialize() + private Date beginDate; + /** + * 任务结束时间 + */ + @ApiModelProperty(value = "任务结束时间") + @TableField("END_DATE") + @JsonFormat(pattern="yyyy-MM-dd") + private Date endDate; + /** + * 任务接收机构;任务接收机构的ID数组组成的字符串 + */ + @ApiModelProperty(value = "任务接收机构;任务接收机构的ID数组组成的字符串") + @TableField("DEPT_IDS") + private String deptIds; + /** + * 任务状态;0-待下发 1-已下发 2-已终止 + */ + @ApiModelProperty(value = "任务状态;0-待下发 1-已下发 2-已终止") + @TableField("STATE") + private String state; + /** + * 相关附件 + */ + @ApiModelProperty(value = "相关附件ID") + @TableField("FILE_IDS") + private String fileIds; + /** + * 表单模板文件ID + */ + @ApiModelProperty(value = "表单模板文件ID") + @TableField("FILE_TEMPLATE_IDS") + private String fileTemplateIds; + /** + * 应报数量 + */ + @ApiModelProperty(value = "应报数量") + @TableField("OUGHT_NUM") + private String oughtNum; + /** + * 已报数量 + */ + @ApiModelProperty(value = "已报数量") + @TableField("FINISH_NUM") + private String finishNum; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 逻辑删除标识符;0-正常,1-删除 + */ + @ApiModelProperty(value = "逻辑删除标识符;0-正常,1-删除") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 检查类型;针对‘检查整改’任务需要区分;1-自检自查;2-内部检查;3-外部检查 + */ + @ApiModelProperty(value = "检查类型;针对‘检查整改’任务需要区分;1-自检自查;2-内部检查;3-外部检查") + @TableField("CHECK_TYPE") + private String checkType; + /** + * 关联事件;针对‘案件防控’的任务下发,需要选择相关联的异常事件 + */ + @ApiModelProperty(value = "关联事件ID") + @TableField("EVENT_ID") + private String eventId; + /** + * 附件groupName + */ + @ApiModelProperty(value = "附件groupName") + @TableField("GROUP_NAME") + private String groupName; + /** + * 任务终止原因 + */ + @ApiModelProperty(value = "任务终止原因") + @TableField("RESERVE4") + private String reserve4; + /** + * 备用字段5 + */ + @ApiModelProperty(value = "备用字段5") + @TableField("RESERVE5") + private String reserve5; + /** + * 检查机构 + */ + @ApiModelProperty(value = "检查机构") + @TableField("INSPECT_DEP") + private String inspectDep; + /** + * 提报角色 + */ + @ApiModelProperty(value = "提报角色") + @TableField("ROLE_ID") + private String roleId; + /** + * 发布人 + */ + @ApiModelProperty(value = "发布人") + private String publisher; + /** + * 发布时间 + */ + @ApiModelProperty(value = "发布时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date publishTime; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/entity/TaskHandin.java b/security-service/ht-security/src/main/java/org/security/trans/task/entity/TaskHandin.java new file mode 100644 index 0000000..3b6b7d2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/entity/TaskHandin.java @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.security.ht.entity.common.BaseEntity; +import org.security.ht.entity.common.FlowEntity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 任务-任务提报实体类 + * + * @author BladeX + * @since 2022-03-14 + */ +@Data +@TableName("T_TASK_HANDIN") +@ApiModel(value = "TaskHandin对象", description = "任务-任务提报") +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class TaskHandin extends FlowEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value = "ID") + @TableId("ID") + private String id; + /** + * 提交时间 + */ + @ApiModelProperty(value = "提交时间") + @TableField("SUBMIT_TIME") + @JsonFormat(pattern="yyyy-MM-dd") + private Date submitTime; + /** + * 关联任务ID + */ + @ApiModelProperty(value = "关联任务ID") + @TableField("TASK_ID") + private String taskId; + /** + * 相关附件 + */ + @ApiModelProperty(value = "相关附件") + @TableField("FILE_IDS") + private String fileIds; + /** + * 提报用户 + */ + @ApiModelProperty(value = "提报用户") + @TableField("USER_ID") + private String userId; + /** + * 提报角色 + */ + @ApiModelProperty(value = "提报角色") + @TableField("ROLE_ID") + private String roleId; + /** + * 所属模块 + */ + @ApiModelProperty(value = "所属模块") + @TableField("MODULE") + private String module; + /** + * 业务类型 + */ + @ApiModelProperty(value = "业务类型") + @TableField("BUSINESS_TYPE") + private String businessType; + /** + * 类型;1-日常任务 2-专项任务 + */ + @ApiModelProperty(value = "类型;1-日常任务 2-专项任务") + @TableField("FLAG") + private String flag; + /** + * 提报期限 + */ + @ApiModelProperty(value = "提报期限") + @TableField("DEADLINE") + @JsonFormat(pattern="yyyy-MM-dd") + private Date deadline; + /** + * 现场照片 + */ + @ApiModelProperty(value = "现场照片") + @TableField("PIC_IDS") + private String picIds; + /** + * 执行次数;用于记录如应急演练‘演练次数’或其他类似次数信息 + */ + @ApiModelProperty(value = "执行次数;用于记录如应急演练‘演练次数’或其他类似次数信息") + @TableField("EXECUTE_NUMBER") + private BigDecimal executeNumber; + /** + * 参与人数;用于记录如应急演练‘参演人数’或其他人数信息 + */ + @ApiModelProperty(value = "参与人数") + @TableField("PEOPLE_NUMBER") + private BigDecimal peopleNumber; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + @TableField("DEPT_ID") + private String deptId; + /** + * 部门名称 + */ + @ApiModelProperty(value = "部门名称") + @TableField("DEPT_NAME") + private String deptName; + /** + * 逻辑删除标识符;1-删除,0-正常 + */ + @ApiModelProperty(value = "逻辑删除标识符;1-删除,0-正常") + @TableField("DEL_FLAG") + @TableLogic + private String delFlag; + /** + * 任务主题-用于记录如应急演练主题、教育培训主题等 + */ + @ApiModelProperty(value = "任务主题") + @TableField("TITLE") + private String title; + /** + * 暂存标志 + */ + @ApiModelProperty(value = "暂存标志") + @TableField("SUBMIT_TYPE") + private String submitType; + /** + * 附件groupName + */ + @ApiModelProperty(value = "附件groupName") + @TableField("GROUP_NAME") + private String groupName; + /** + * 业务状态 0-未提报 1-超时未报 2-按时提报 3-超时提报 4-任务终止 + */ + @ApiModelProperty(value = "业务状态 0-未提报 1-超时未报 2-按时提报 3-超时提报 4-任务终止") + @TableField("STATUS") + private String status; + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/entity/TaskTodo.java b/security-service/ht-security/src/main/java/org/security/trans/task/entity/TaskTodo.java new file mode 100644 index 0000000..9d1e7e2 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/entity/TaskTodo.java @@ -0,0 +1,103 @@ +package org.security.trans.task.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @author Created by yzy + * @date 2022/4/22 14:21 + */ +@Data +@ApiModel(value = "TaskTodo对象", description = "任务-待办事项") +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class TaskTodo { + /** + * ID + */ + @ApiModelProperty(value = "ID") + private String id; + + /** + * 待办任务对应实体名 + * taskHandin-应急演练、教育培训 + * inspection-检查整改 + * assessment-考核评价 + * SccUnlocaleCheck-非现场检查整改 + * SccAlarmPush-警情处理 + * prevent-案件材料报送 + */ + @ApiModelProperty(value = "待办实体名") + private String entityName; + + /** + * 提报机构ID + */ + @ApiModelProperty(value = "提报机构ID") + private String department; + + /** + * 提报用户 + */ + @ApiModelProperty(value = "提报用户") + private String userId; + + /** + * 提报角色 + */ + @ApiModelProperty(value = "提报角色") + private String roleId; + /** + * 提报部门id + */ + @ApiModelProperty(value = "提报部门id") + private String deptId; + /** + * 所属模块 + */ + @ApiModelProperty(value = "所属模块") + private String module; + + /** + * 业务类型 + */ + @ApiModelProperty(value = "业务类型") + private String businessType; + /** + * 任务类型;1-日常任务 2-专项任务 + */ + @ApiModelProperty(value = "类型;1-日常任务 2-专项任务") + private String flag; + /** + * 待办状态;1-代签收 2-待提报 3-超时待签收 4-超时待提报 + */ + @ApiModelProperty(value = "状态;1-代签收 2-待提报 3-超时待签收 4-超时待提报") + private String state; + + /** + * 提报期限 + */ + @ApiModelProperty(value = "提报期限") + @JsonFormat(pattern="yyyy-MM-dd") + private Date deadline; + + + /** + * 源业务id + */ + @ApiModelProperty(value = "源业务id") + private String linkId; + /** + * 任务名称 + */ + @ApiModelProperty(value = "任务名称") + private String taskName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskHandinMapper.java b/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskHandinMapper.java new file mode 100644 index 0000000..3b1d71d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskHandinMapper.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.mapper; + +import org.apache.ibatis.annotations.Param; +import org.security.trans.assessment.entity.Assessment; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.dailyDuties.entity.InspectionLine; +import org.security.trans.dataStatistics.dto.EduAndDrillDataDTO; +import org.security.trans.dataStatistics.vo.EduAndDrillDataVO; +import org.security.trans.prevent.entity.PreventMaterial; +import org.security.trans.securityCommandCenter.entity.SccAlarmPush; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import org.security.trans.task.dto.TaskDTO; +import org.security.trans.task.dto.TaskHandinDTO; +import org.security.trans.task.entity.Task; +import org.security.trans.task.entity.TaskHandin; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; + +import java.util.List; + +/** + * 任务-任务提报 Mapper 接口 + * + * @author BladeX + * @since 2022-03-14 + */ +public interface TaskHandinMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param taskHandinDTO + * @return + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectTaskHandinPage(IPage page, @Param("taskHandinDTO") TaskHandinDTO taskHandinDTO); + + List selectTaskPage(@Param("taskDTO") TaskDTO taskDTO); + + List getByRoleAndDept(@Param("roleId") String roleId,@Param("deptId") String deptId); + +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectTaskHandinTodo(@Param("userId") String userId); + +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectInspectionTodo(@Param("userId") String userId); + +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectInspectionLineTodo(@Param("userId") String userId); + +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectAssessmentTodo(@Param("userId") String userId); + +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectPreventTodo(@Param("userId") String userId); + +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectSccUnlocaleCheckTodo(@Param("userId") String userId); + +// @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectSccAlarmPushTodo(@Param("roleId") String roleId, @Param("deptId") String deptId); + + List getAppBacklog(@Param("userId") String userId, @Param("state") String state,@Param("moduleType") String moduleType); + + List selectUnLocalCheckContinued(@Param("userId") String userId); + + String getDeptName(@Param("deptId") String deptId); + + List getAimStatisticsData(@Param("eduAndDrillDataDTO") EduAndDrillDataDTO eduAndDrillDataDTO, @Param("aimDepts") List aimDepts, @Param("aimModule") String aimModule); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskHandinMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskHandinMapper.xml new file mode 100644 index 0000000..d1f1355 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskHandinMapper.xml @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskMapper.java b/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskMapper.java new file mode 100644 index 0000000..41f208f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskMapper.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.mapper; + +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.security.trans.task.dto.TaskDTO; +import org.security.trans.task.entity.Task; +import org.security.trans.task.vo.TaskVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.datascope.annotation.DataAuth; +import org.springblade.core.datascope.enums.DataScopeEnum; +import org.security.system.entity.Role; + +import java.util.List; + +/** + * 任务-任务下发 Mapper 接口 + * + * @author BladeX + * @since 2022-03-10 + */ +public interface TaskMapper extends BaseMapper { + + /** + * 自定义分页 + */ + @DataAuth(type = DataScopeEnum.OWN_DEPT_CHILD, column = "DEPT_ID") + List selectTaskPage(IPage page,@Param("taskDTO") TaskDTO taskDTO); + + List selectRoleList(); + /** + * 获取用户名称 + * @param userId 用户id + * @return + */ + String getUserName(@Param("userId") String userId); + + /** + * 查询出t_user_sync_history中启用而t_employee禁用的员工,返回其员工号 + */ + @Select("select a.empe_num from t_user_sync_history a LEFT JOIN t_employee b on a.empe_num = b.employee_no where a.forbid_sts='1' and b.del_flag='1';") + List selectReopenEmployee(); + + /** + * 查询出t_user_sync_history中启用而blade_user禁用的员工,返回其员工号 + */ + @Select("select a.empe_num from t_user_sync_history a LEFT JOIN blade_user b on a.empe_num = b.code where a.forbid_sts='1' and b.is_deleted=1;") + List selectReopenUser(); + + /** + * 查询出t_dept_sync_history中启用而blade_dept禁用的机构,返回其机构号 + */ + @Select("SELECT a.insti_enc from t_dept_sync_history a LEFT JOIN blade_dept b on a.insti_enc = b.dept_code where a.org_ste='0' and b.is_deleted=1;") + List selectReopenDept(); + /** + * 查询出t_dept_sync_history中启用而t_department禁用的机构,返回其机构号 + */ + @Select("SELECT a.insti_enc from t_dept_sync_history a LEFT JOIN t_department b on a.insti_enc = b.dept_no where a.org_ste='0' and b.del_flag='1';") + List selectReopenDepartment(); + + boolean updateReopenEmployee(@Param("empNo") String empNo); + boolean updateReopenUser(@Param("empNo") String empNo); + boolean updateReopenDept(@Param("depNo") String depNo); + boolean updateReopenDepartment(@Param("depNo") String depNo); + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskMapper.xml new file mode 100644 index 0000000..6660e9f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/mapper/TaskMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update T_EMPLOYEE set DEL_FLAG='0' where employee_no = #{empNo} + + + update BLADE_USER set IS_DELETED=0 where code = #{empNo} + + + update BLADE_DEPT set IS_DELETED=0 where dept_code = #{depNo} + + + update T_DEPARTMENT set DEL_FLAG='0' where dept_no = #{depNo} + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/service/ITaskHandinService.java b/security-service/ht-security/src/main/java/org/security/trans/task/service/ITaskHandinService.java new file mode 100644 index 0000000..cc4ab09 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/service/ITaskHandinService.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.trans.app.vo.BacklogVO; +import org.security.trans.common.service.FlowableService; +import org.security.trans.dataStatistics.dto.EduAndDrillDataDTO; +import org.security.trans.dataStatistics.dto.StatisticsDataDTO; +import org.security.trans.dataStatistics.vo.EduAndDrillDataVO; +import org.security.trans.task.dto.TaskDTO; +import org.security.trans.task.dto.TaskHandinDTO; +import org.security.trans.task.entity.TaskHandin; +import org.security.trans.task.vo.TaskHandinVO; +import org.security.trans.task.vo.TaskTodoVO; +import org.security.trans.taskCheck.task.dto.TaskHandinCheckDTO; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.tool.api.R; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.util.List; + +/** + * 任务-任务提报 服务类 + * + * @author BladeX + * @since 2022-03-14 + */ +public interface ITaskHandinService extends FlowableService { + + /** + * 自定义分页 + * + * @param page + * @param taskHandinDTO + * @return + */ + IPage selectTaskHandinPage(IPage page, TaskHandinDTO taskHandinDTO); + + /** + * 暂存 + * + * @param taskHandin + * @return + */ + R saveTaskHandin(TaskHandinDTO taskHandin); + + + /** + * 提报 + * + * @param taskHandin + * @return + */ + R handin(TaskHandinDTO taskHandin) throws ParseException; + + /** + * 查询详情 + * + * @param id + * @return + */ + TaskHandinVO getDetail(BigDecimal id); + + /** + * 发布任务并新建对应的taskHandin + * + * @param task 任务信息 + * @return + */ + R publishTask(TaskDTO task); + + TaskHandin getTaskHandin(TaskHandinCheckDTO taskHandinCheckDTO); + + List getTaskList(String status); + + /** + * 查询app用户待办 + * + * @param user + * @return + */ + List getAppBacklog(BladeUser user,String moduleType); + + /** + * 待办事项分页 + * + * @param + * @return + */ + List selectTaskTodo(); + + /** + * 暂存 + * + * @param taskHandin + * @return + */ + Boolean updateTaskHandin(TaskHandin taskHandin); + + R endTaskByIds( TaskDTO task); + + /** + *定时任务-教育培训或应急演练获取机构名称 + */ + String getDeptName(String deptId); + + /** + *教育培训/应急演练数据统计列表数据获取 + */ + List getAimStatisticsData(EduAndDrillDataDTO eduAndDrillDataDTO, List aimDepts, String aimModule); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/service/ITaskService.java b/security-service/ht-security/src/main/java/org/security/trans/task/service/ITaskService.java new file mode 100644 index 0000000..5cadc6a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/service/ITaskService.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.trans.task.dto.TaskDTO; +import org.security.trans.task.entity.Task; +import org.security.trans.task.vo.TaskVO; +import org.security.system.entity.Role; +import org.springblade.core.tool.api.R; + +import java.util.Date; +import java.util.List; + +/** + * 任务-任务下发 服务类 + * + * @author BladeX + * @since 2022-03-10 + */ +public interface ITaskService extends IService { + + /** + * 自定义分页 + * + * @param page + * @param task + * @return + */ + IPage selectTaskPage(IPage page, TaskDTO task); + + /** + * 暂存 + * + * @param task + * @return + */ + R saveTask(TaskDTO task); + + List getTaskCheckList(String frequency, String state, Date beginDate, Date endDate); + + List getRoleList(); + /** + * 查询详情 + * + * @param id + * @return + */ + TaskVO getDetail(String id); + + List getTaskOvertimeList(String state, Date endDate); + /** + * 定时任务-重启用员工 + */ + boolean reopenEmployee(); + /** + * 定时任务-重启用机构 + */ + boolean reopenDept(); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/service/impl/TaskHandinServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/task/service/impl/TaskHandinServiceImpl.java new file mode 100644 index 0000000..5b37d08 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/service/impl/TaskHandinServiceImpl.java @@ -0,0 +1,665 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.security.common.Constant; +import org.security.common.util.DeadlineUtil; +import org.security.flow.core.constant.ProcessConstant; +import org.security.flow.core.entity.BladeFlow; +import org.security.flow.core.entity.BladeFlowDef; +import org.security.flow.core.feign.IFlowClient; +import org.security.flow.core.utils.FlowUtil; +import org.security.ht.vo.common.UploadVO; +import org.security.system.feign.ISysClient; +import org.security.trans.app.vo.BacklogVO; +import org.security.ht.entity.basic.Department; +import org.security.trans.assessment.entity.Assessment; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.dailyDuties.entity.InspectionLine; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.dataStatistics.dto.EduAndDrillDataDTO; +import org.security.trans.dataStatistics.vo.EduAndDrillDataVO; +import org.security.trans.prevent.dto.PreventMaterialDTO; +import org.security.trans.prevent.entity.PreventMaterial; +import org.security.trans.prevent.service.IPreventMaterialService; +import org.security.trans.securityCommandCenter.entity.SccAlarmPush; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheckLine; +import org.security.trans.task.dto.TaskDTO; +import org.security.trans.task.dto.TaskHandinDTO; +import org.security.trans.task.entity.Task; +import org.security.trans.task.entity.TaskHandin; +import org.security.trans.task.mapper.TaskHandinMapper; +import org.security.trans.task.service.ITaskHandinService; +import org.security.trans.task.service.ITaskService; +import org.security.trans.task.vo.TaskHandinVO; +import org.security.trans.task.vo.TaskTodoVO; +import org.security.trans.taskCheck.task.dto.TaskHandinCheckDTO; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.support.Kv; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +import static org.security.common.Constant.*; + +/** + * 任务-任务提报 服务实现类 + * + * @author BladeX + * @since 2022-03-14 + */ +@Service +@Slf4j +@AllArgsConstructor +public class TaskHandinServiceImpl extends ServiceImpl implements ITaskHandinService { + + private final IDepartmentService departmentService; + + private final ITaskService taskService; + + private final IInspectionService inspectionService; + + private final IPreventMaterialService preventMaterialService; + + private final IFileService fileService; + + private final IFlowClient flowClient; + + private final ISysClient sysClient; + + @Override + public IPage selectTaskHandinPage(IPage page, TaskHandinDTO taskHandinDTO) { + String user = String.valueOf(AuthUtil.getUserId()); + log.info("=======当前登录人userID:{}======", user); + List taskHandinList = baseMapper.selectTaskHandinPage(page, taskHandinDTO); + List taskHandinVOList = new ArrayList<>(); + taskHandinList.forEach(tsh -> { + TaskHandinVO taskHandinVO = Func.copy(tsh, TaskHandinVO.class); + assert taskHandinVO != null; + // 若关联任务,赋值任务名称 + if (Func.isNotBlank(tsh.getTaskId())) { + Task task = taskService.getOne(new QueryWrapper().lambda().eq(Task::getId, tsh.getTaskId())); + taskHandinVO.setTaskName(task.getName()); + } + // 创建人名称 + taskHandinVO.setCreatedByName(fileService.getUserNameById(taskHandinVO.getCreatedBy())); + // 更新人名称 + taskHandinVO.setUpdatedByName(fileService.getUserNameById(taskHandinVO.getUpdatedBy())); + taskHandinVOList.add(taskHandinVO); + }); + return page.setRecords(taskHandinVOList); + } + + @Override + public TaskHandinVO getDetail(BigDecimal id) { + TaskHandin detail = super.getById(id); + TaskHandinVO taskHandinVO = new TaskHandinVO(); + BeanUtils.copyProperties(detail, taskHandinVO); + if (Func.isNotBlank(detail.getTaskId())) { + Task task = taskService.getOne(new QueryWrapper().lambda().eq(Task::getId, detail.getTaskId())); + taskHandinVO.setTaskName(task.getName()); + } + taskHandinVO.setFileList(fileService.getAttachments(detail.getId(), detail.getGroupName())); + return taskHandinVO; + } + + @Override + public R saveTaskHandin(TaskHandinDTO taskHandinDTO) { + TaskHandin taskHandin = BeanUtil.copyProperties(taskHandinDTO, TaskHandin.class); + if (Func.isNull(taskHandin.getDeptId()) || Func.isEmpty(taskHandin.getDeptId())) { + taskHandin.setDeptId(String.valueOf(AuthUtil.getDeptId())); + } + if (Func.isNull(taskHandin.getUserId()) || Func.isEmpty(taskHandin.getUserId())) { + taskHandin.setUserId(String.valueOf(AuthUtil.getUserId())); + } + super.saveOrUpdate(taskHandin); + List fileList = taskHandinDTO.getFileList(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, taskHandin.getId()); + } + return R.data(taskHandin); + } + + @Override + public R handin(TaskHandinDTO taskHandinDTO) throws ParseException { + R res = saveTaskHandin(taskHandinDTO); + if (!res.isSuccess()) { + throw new ServiceException("保存失败!"); + } + TaskHandin taskHandin = res.getData(); + // 查询对应流程模型定义 + R definitionRes = flowClient.getLatestProcessDefinitionByKey("edu".equals(taskHandin.getModule()) ? ProcessConstant.TASK_HANDIN_EDU_KEY : ProcessConstant.TASK_HANDIN_DRILL_KEY); + if (definitionRes.isSuccess()) { + taskHandin.setProcessDefinitionId(definitionRes.getData().getId()); + } else { + return R.fail(400, "流程模型未定义"); + } + R deptCategory = sysClient.getDeptCategory(Long.valueOf(AuthUtil.getUser().getDeptId())); + if (!deptCategory.isSuccess()) { + throw new ServiceException("查询部门类型失败,请检查后再试!"); + } + String businessTable = FlowUtil.getBusinessTable(TaskHandin.class); + Kv variables = Kv.create() + .set("deptCategory", deptCategory.getData()) + .set(ProcessConstant.BUSINESS_ID_KEY, taskHandin.getId()) + .set(ProcessConstant.START_PROC_USER_ID, AuthUtil.getUserId()); + if (1 == deptCategory.getData()) { + variables.set(ProcessConstant.PASS_KEY, true); + } + taskHandin.setState(HANDIN_STATE_AUDIT);//审批中 + this.saveOrUpdate(taskHandin); + R result = flowClient.startProcessInstanceById(taskHandin.getProcessDefinitionId(), FlowUtil.getBusinessKey(businessTable, String.valueOf(taskHandin.getId())), variables); + if (result.isSuccess()) { + log.debug("流程已启动,流程ID:" + result.getData().getProcessInstanceId()); + // 返回流程id写入taskHandin + TaskHandin afterStartHandin = this.getById(taskHandin.getId()); + afterStartHandin.setProcessInstanceId(result.getData().getProcessInstanceId()); + afterStartHandin.setSubmitTime(new Date()); + Date deadline = afterStartHandin.getDeadline(); + if (!Func.isNull(deadline) && Func.isNotEmpty(deadline)) { + afterStartHandin.setStatus(deadline.after(new Date()) ? TASK_HANDIN_STATE_SUBMIT : TASK_HANDIN_STATE_OVERTIME_SUBMIT);//业务状态 + } else { + afterStartHandin.setStatus(TASK_HANDIN_STATE_SUBMIT); + } + this.updateById(afterStartHandin); + return R.success("提交成功"); + } else { + return R.fail(400, "开启流程失败"); + } + } + + + @Override + @Transactional(rollbackFor = Exception.class) + public R publishTask(TaskDTO task){ +// 若是日常任务,且不是调整机构后对新增机构进行任务发布,则根据业务类型查询是否存在已发布的同类型任务,若存在则返回提示信息 + if (TASK_FLAG_USUAL.equals(task.getFlag()) && !TASK_STATE_PUBLISH.equals(task.getState())) { + TaskDTO taskDTO = new TaskDTO(); + taskDTO.setModule(task.getModule()); + taskDTO.setState(TASK_STATE_PUBLISH); + taskDTO.setFlag(task.getFlag()); + taskDTO.setBusinessType(task.getBusinessType()); + List tList = baseMapper.selectTaskPage(taskDTO); + if (!Func.isNull(tList) && tList.size() > 0) { + return R.fail(400, "已存在该业务类型的日常任务,请勿重复发布!"); + } + } + if (Func.isNull(task.getNum()) || Func.isBlank(task.getNum())) { + //任务编号 + task.setNum(Constant.TASK_PREFIX + (new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()))); + } + if (Func.isNull(task.getDeptId()) || Func.isBlank(task.getDeptId())) { + task.setDeptId(String.valueOf(AuthUtil.getDeptId())); + } + task.setPublisher(String.valueOf(AuthUtil.getUserId()));//记录发布人 + task.setPublishTime(new Date());//发布时间 + taskService.saveOrUpdate(task); + log.info("=======task:{}=====", task); + //创建对应类型、对应机构的任务 + String deptIds = task.getDeptIds(); + List list = Arrays.asList(deptIds.split(",")); + List depList = new ArrayList(list); + String deadline = DeadlineUtil.getDDLByFreq(task.getFrequency(), task.getEndDate()); +// 根据所属模块、业务类型等判断应创建的任务是什么entity + if (Func.isNotBlank(task.getModule()) && ("daily").equals(task.getModule())) { + //若是检查整改模块 创建‘检查整改’表记录 + setInspection(task, depList, deadline); + } else if (Func.isNotBlank(task.getModule()) && ("prevent").equals(task.getModule())) { + //若是案件防控模块 创建‘案件材料报送’表记录 + setPrevent(task, depList, deadline); + } else {//其他类业务 创建‘任务提报’表记录 + setTaskHandin(task, depList, deadline); + } + //修改任务状态 + task.setState(Constant.TASK_STATE_PUBLISH); + taskService.updateById(task); + return R.success("提交成功"); + } + + private void setTaskHandin(TaskDTO task, List depList, String deadline) { + depList.forEach(d -> { + Department dEntity = departmentService.getById(d); + TaskHandin taskHandin = new TaskHandin(); + taskHandin.setTaskId(task.getId()); + taskHandin.setDeptId(d); + taskHandin.setDeptName(dEntity.getDeptName()); + taskHandin.setModule(task.getModule()); + taskHandin.setBusinessType(task.getBusinessType()); + taskHandin.setDeadline(Func.isNotEmpty(deadline) ? DateUtil.parse(deadline, DateUtil.PATTERN_DATE) : null); + taskHandin.setFlag(task.getFlag()); + taskHandin.setState(HANDIN_STATE_DRAFT); + taskHandin.setStatus(TASK_HANDIN_STATE_DRAFT); + taskHandin.setRoleId(task.getRoleId()); + taskHandin.setUserId(this.getUserIds(task.getRoleId(), d)); + this.save(taskHandin); + }); + } + + private void setInspection(TaskDTO task, List depList, String deadline) { + depList.forEach(d -> { + Inspection inspection = new Inspection(); + inspection.setTaskId(task.getId());//关联任务id + inspection.setDeptId(INSPECTION_TYPE_IN.equals(task.getCheckType()) ? task.getInspectDep() : d);//任务提报机构 若是内部检查,由检查机构进行提报;其他直接取d + inspection.setDeptName(inspectionService.getDeptData(inspection.getDeptId()));//赋值机构名称 + inspection.setType(task.getFlag());//任务类型 usual-日常类 unusual-专项类 + inspection.setCheckType(task.getCheckType());//检查类型 1-自检自查 2-内部检查 3-外部检查 + inspection.setInspectedDep(d);//被检查机构,默认取提报机构 + inspection.setInspectDep(INSPECTION_TYPE_SELF.equals(task.getCheckType()) ? d : task.getInspectDep());//检查机构,如果是自检自查,就取被检查机构 + inspection.setState(HANDIN_STATE_DRAFT);//流程状态,默认为 未提交审批 + inspection.setStatus(PROBLEM_STATE_DRAFT);//业务状态,默认为 待检查 + inspection.setRoleId(task.getRoleId());//提报角色 + inspection.setUserId(this.getUserIds(task.getRoleId(), inspection.getDeptId()));//提报用户 + inspection.setBusinessType(task.getBusinessType());//业务类型 + inspection.setDeadline(Func.isNotEmpty(deadline) ? DateUtil.parse(deadline, DateUtil.PATTERN_DATE) : null);//提报期限 + inspection.setModule("daily");//所属模块 检查整改-daily + inspectionService.save(inspection); + }); + } + + // 案件防控-案件材料报送对象 + private void setPrevent(TaskDTO task, List depList, String deadline) { + depList.forEach(d -> { + PreventMaterialDTO pm = new PreventMaterialDTO(); + pm.setTaskId(task.getId());//关联任务id + pm.setDeptId(d);//任务提报机构 + pm.setState(HANDIN_STATE_DRAFT);//流程状态,默认为 0-待提报 + pm.setStatus(TASK_HANDIN_STATE_DRAFT);//业务状态 0-待提报 + pm.setRoleId(task.getRoleId());//提报角色 + pm.setUserId(this.getUserIds(task.getRoleId(), d));//提报用户 + pm.setDeadline(Func.isNotEmpty(deadline) ? DateUtil.parse(deadline, DateUtil.PATTERN_DATE) : null);//提报期限 + pm.setType(task.getBusinessType());//业务类型 + preventMaterialService.saveMaterial(pm); + }); + } + + private String getUserIds(String roleId, String deptId) { + String userId = ""; + if (!"".equals(roleId) && !"".equals(deptId)) { + List userList = baseMapper.getByRoleAndDept(roleId, deptId); + if (Func.isNotEmpty(userList)) { + userId = StringUtils.join(userList, ','); + } + } + return userId; + } + + @Override + public TaskHandin getTaskHandin(TaskHandinCheckDTO taskHandinCheckDTO) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(StringUtils.isNotBlank(taskHandinCheckDTO.getTaskId()), "TASK_ID", taskHandinCheckDTO.getTaskId()); + queryWrapper.eq(StringUtils.isNotBlank(taskHandinCheckDTO.getDeptId()), "DEPT_ID", taskHandinCheckDTO.getDeptId()); + queryWrapper.le(Func.isNotEmpty(taskHandinCheckDTO.getCreatEndDate()), "created_time", taskHandinCheckDTO.getCreatEndDate()); + queryWrapper.ge(Func.isNotEmpty(taskHandinCheckDTO.getCreatStartDate()), "created_time", taskHandinCheckDTO.getCreatStartDate()); +// queryWrapper.eq(StringUtils.isNotBlank(taskHandinCheckDTO.getStatus()), "STATE", taskHandinCheckDTO.getStatus()); + return baseMapper.selectOne(queryWrapper); + } + + @Override + public List getTaskList(String status) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("STATUS", status); + return baseMapper.selectList(queryWrapper); + } + + @Override + public List selectTaskTodo() { + log.info("---------------首页待办查询开始---------------"); + String roleId = String.valueOf(AuthUtil.getUser().getRoleId()); + List list = Arrays.asList(roleId.split(",")); + String userId = String.valueOf(AuthUtil.getUserId()); + List taskTodoVOList = new ArrayList<>(); + //应急演练和教育培训待办 + getTaskHandinTodo(userId, taskTodoVOList); + //检查待办 + getInspectionTodo(userId, taskTodoVOList); + //整改待办 + getInspectionLineTodo(userId, taskTodoVOList); + //考核评价待办 + getAssessmentTodo(userId, taskTodoVOList); + //案件防控待办 + getPreventTodo(userId, taskTodoVOList); + //安保指挥中心非现场检查整改通知书待办 + getUnLocalCheckTodo(userId, taskTodoVOList); + //安保指挥中心警情处理待办 + getAlarmPushTodo(list, AuthUtil.getDeptId(), taskTodoVOList); + //安保指挥中心非现场检查整改-持续整改待办 + getUnLocalCheckContinedTodo(userId, taskTodoVOList); + log.info("---------------首页待办查询结束---------------"); + log.info("首页待办列表数据:[{}]", taskTodoVOList.toString()); + List collect = taskTodoVOList.stream().sorted(Comparator.comparing(TaskTodoVO::getUpdateTime, Comparator.nullsLast(Comparator.reverseOrder()))).collect(Collectors.toList()); + log.info("排序后待办数据为:[{}]", collect); + return collect; + } + + /** + * 安保指挥中心非现场检查整改-持续整改待办 + */ + private void getUnLocalCheckContinedTodo(String userId, List taskTodoVOList) { + log.info("-----------------获取安保指挥中心非现场检查整改-持续整改待办开始-----------------"); + List SccUnlocaleCheckLineList = baseMapper.selectUnLocalCheckContinued(userId); + if (Func.isNotEmpty(SccUnlocaleCheckLineList)) { + log.info("安保指挥中心非现场检查整改-持续整改待办[{}]", SccUnlocaleCheckLineList); + SccUnlocaleCheckLineList.forEach(item -> { + TaskTodoVO tt = new TaskTodoVO(); + tt.setEntityName("unLocalCheckContinued"); + tt.setId(item.getId()); + tt.setModule("unLocalCheckContinued"); + tt.setBusinessType("非现场检查整改-持续整改"); + tt.setTaskName(Func.isNotEmpty(item.getProblemsDescribe()) ? item.getProblemsDescribe() : "无相关任务"); + tt.setFlag(null); + tt.setDeptId(item.getDeptId()); + tt.setState(item.getState()); + tt.setDeadline(Func.isNotEmpty(item.getRectificationDeadline()) ? item.getRectificationDeadline() : null); + tt.setUpdateTime(item.getUpdatedTime()); + taskTodoVOList.add(tt); + }); + } + log.info("-----------------获取安保指挥中心非现场检查整改-持续整改待办结束-----------------"); + } + + /** + * 应急演练和教育培训待办 + */ + private void getTaskHandinTodo(String userId, List taskTodoVOList) { + log.info("-----------------获取应急演练和教育培训待办开始-----------------"); + List taskHandinList = baseMapper.selectTaskHandinTodo(userId); + if (Func.isNotEmpty(taskHandinList)) { + log.info("应急演练和教育培训待办[{}]", taskHandinList); + taskHandinList.forEach(th -> { + TaskTodoVO tt = new TaskTodoVO(); + tt.setEntityName("taskHandin"); + tt.setId(th.getId()); + tt.setTaskName(Func.isNotEmpty(taskService.getDetail(th.getTaskId())) ? taskService.getDetail(th.getTaskId()).getName() : "无关联任务"); + tt.setModule(th.getModule()); + tt.setBusinessType(th.getBusinessType()); + tt.setFlag(th.getFlag()); + tt.setDeptId(th.getDeptId()); + tt.setState(th.getState()); + tt.setRoleId(th.getRoleId()); + tt.setUserId(th.getUserId()); + tt.setDeadline(Func.isNotEmpty(th.getDeadline()) ? th.getDeadline() : null); + tt.setUpdateTime(th.getUpdatedTime()); + taskTodoVOList.add(tt); + }); + } + log.info("-----------------获取应急演练和教育培训待办开始-----------------"); + } + + /** + * 检查待办 + */ + private void getInspectionTodo(String userId, List taskTodoVOList) { + log.info("-----------------获取现场检查待办开始-----------------"); + List inspectionList = baseMapper.selectInspectionTodo(userId); + if (Func.isNotEmpty(inspectionList)) { + log.info("现场检查待办[{}]", inspectionList); + inspectionList.forEach(item -> { + TaskTodoVO tt = new TaskTodoVO(); + tt.setEntityName("inspection"); + tt.setId(item.getId()); + tt.setTaskName(Func.isNotEmpty(taskService.getDetail(item.getTaskId())) ? taskService.getDetail(item.getTaskId()).getName() : "无关联任务"); + tt.setModule("inspection"); + tt.setBusinessType(item.getBusinessType()); + tt.setFlag(item.getType()); + tt.setDeptId(item.getDeptId()); + tt.setDepartment(item.getInspectDep()); + tt.setState(item.getState()); + tt.setRoleId(item.getRoleId()); + tt.setUserId(item.getUserId()); + tt.setDeadline(Func.isNotEmpty(item.getDeadline()) ? item.getDeadline() : null); + tt.setUpdateTime(item.getUpdatedTime()); + taskTodoVOList.add(tt); + }); + } + log.info("-----------------获取现场检查待办结束-----------------"); + } + + /** + * 整改待办 + */ + private void getInspectionLineTodo(String userId, List taskTodoVOList) { + log.info("-----------------获取现场检查整改待办开始-----------------"); + List inspectionLineList = baseMapper.selectInspectionLineTodo(userId); + if (Func.isNotEmpty(inspectionLineList)) { + log.info("现场检查整改待办[{}]", inspectionLineList); + inspectionLineList.forEach(item -> { + TaskTodoVO tt = new TaskTodoVO(); + tt.setBusinessType("现场检查整改"); + tt.setTaskName(Func.isNotEmpty(item.getContent()) ? item.getContent() : "无关联任务"); + tt.setEntityName("inspectionLine"); + tt.setId(item.getId()); + tt.setModule("inspectionLine"); + tt.setDeptId(item.getDeptId()); + tt.setState(item.getState());//审批状态 + tt.setRoleId(item.getRoleId()); + tt.setUserId(item.getUserId()); + tt.setDeadline(Func.isNotEmpty(item.getRectifyDeadline()) ? item.getRectifyDeadline() : null); + tt.setUpdateTime(item.getUpdatedTime()); + taskTodoVOList.add(tt); + }); + } + log.info("-----------------获取现场检查整改待办结束-----------------"); + } + + /** + * 考核评价待办 + */ + private void getAssessmentTodo(String userId, List taskTodoVOList) { + log.info("-----------------获取考核评价待办开始-----------------"); + List aList = baseMapper.selectAssessmentTodo(userId); + if (Func.isNotEmpty(aList)) { + log.info("考核评价待办[{}]", aList); + aList.forEach(item -> { + TaskTodoVO tt = new TaskTodoVO(); + tt.setEntityName("assessment"); + tt.setId(item.getId()); + tt.setTaskName(Func.isNotEmpty(item.getEvaluationName()) ? item.getEvaluationName() : "无关联任务"); + tt.setModule("assessment"); + tt.setBusinessType("相关方考核"); + tt.setDeptId(item.getDeptId()); + tt.setState(item.getState()); + tt.setRoleId(item.getRoleId()); + tt.setUserId(item.getUserId()); + tt.setDeadline(null); + tt.setUpdateTime(item.getUpdatedTime()); + taskTodoVOList.add(tt); + }); + } + log.info("-----------------获取考核评价待办结束-----------------"); + } + + /** + * 案件防控待办 + */ + private void getPreventTodo(String userId, List taskTodoVOList) { + log.info("-----------------获取案件防控待办开始-----------------"); + List pList = baseMapper.selectPreventTodo(userId); + if (Func.isNotEmpty(pList)) { + log.info("案件防控待办[{}]", pList); + pList.forEach(item -> { + TaskTodoVO tt = new TaskTodoVO(); + tt.setEntityName("prevent"); + tt.setId(item.getId()); + tt.setTaskName(Func.isNotEmpty(item.getTaskId()) ? taskService.getDetail(item.getTaskId()).getName() : "无关联任务"); + tt.setModule("prevent"); + tt.setBusinessType(item.getType()); + tt.setDeptId(item.getDeptId()); + tt.setState(item.getState()); + tt.setRoleId(item.getRoleId()); + tt.setUserId(item.getUserId()); + tt.setDeadline(Func.isNotEmpty(item.getDeadline()) ? item.getDeadline() : null); + tt.setUpdateTime(item.getUpdatedTime()); + taskTodoVOList.add(tt); + }); + } + log.info("-----------------获取案件防控待办结束-----------------"); + } + + /** + * 获取非现场检查整改通知书待办 + * 非现场检查整改通知书业务状态 0-暂存;1-待整改,2-按时整改,3-超时整改,4-超时未整改,5-持续整改,6-待安全员确认 + * 需要查出status为1和4的,并对应todo的state改为0和1 + */ + private void getUnLocalCheckTodo(String userId, List taskTodoVOList) { + log.info("-----------------获取安保指挥中心非现场检查整改通知书待办开始-----------------"); + List sccUnlocaleChecksList = baseMapper.selectSccUnlocaleCheckTodo(userId); + if (Func.isNotEmpty(sccUnlocaleChecksList)) { + log.info("安保指挥中心非现场检查整改通知书待办[{}]", sccUnlocaleChecksList); + sccUnlocaleChecksList.forEach(item -> { + TaskTodoVO tt = new TaskTodoVO(); + tt.setEntityName("SccUnlocaleCheck"); + tt.setId(item.getId()); + tt.setModule("SccUnlocaleCheck"); + tt.setBusinessType("非现场检查整改通知书待办"); + tt.setTaskName(Func.isNotEmpty(item.getDocumentNo()) ? item.getDocumentNo() : "无关联任务"); + tt.setDeptId(item.getDeptId()); + tt.setState(item.getState()); + tt.setDeadline(Func.isNotEmpty(item.getRectificationDeadline()) ? item.getRectificationDeadline() : null); + tt.setUpdateTime(item.getUpdatedTime()); + taskTodoVOList.add(tt); + }); + } + log.info("-----------------获取安保指挥中心非现场检查整改通知书待办结束-----------------"); + } + + /** + * 获取警情处理待办 + */ + private void getAlarmPushTodo(List list, String deptId, List taskTodoVOList) { + log.info("-----------------获取安保指挥中心警情处理待办开始-----------------"); + list.forEach(roleId -> { + List sccAlarmPushesList = baseMapper.selectSccAlarmPushTodo(roleId, deptId); + if (Func.isNotEmpty(sccAlarmPushesList)) { + log.info("安保指挥中心警情处理待办[{}]", sccAlarmPushesList); + sccAlarmPushesList.forEach(item -> { + TaskTodoVO tt = new TaskTodoVO(); + tt.setEntityName("SccAlarmPush"); + tt.setId(item.getId()); + tt.setModule("SccAlarmPush"); + tt.setBusinessType("警情处理待办"); + tt.setTaskName(Func.isNotEmpty(item.getEventDescription()) ? item.getEventDescription() : "无关联任务"); + tt.setDeptId(item.getDeptId()); + tt.setState(item.getState()); + tt.setDeadline(null); + tt.setUpdateTime(item.getUpdatedTime()); + taskTodoVOList.add(tt); + }); + } + }); + log.info("-----------------获取安保指挥中心警情处理待办结束-----------------"); + } + + @Override + public Boolean updateTaskHandin(TaskHandin taskHandin) { + taskHandin.setSubmitType(SUBMIT_TYPE_ZERO); + return this.updateById(taskHandin); + } + + @Override + public List getAppBacklog(BladeUser user, String moduleType) { + return baseMapper.getAppBacklog(String.valueOf(user.getUserId()), HANDIN_STATE_DRAFT, moduleType); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R endTaskByIds(TaskDTO task) { + task.setState(Constant.TASK_STATE_END); + //终止检查整改任务 + endInspection(task); + //终止教育培训任务或应急演练培训任务 + endTaskIn(task); + //案件防控任务终止 + endPrevent(task); + return taskService.saveTask(task); + } + + @Override + public String getDeptName(String deptId) { + return baseMapper.getDeptName(deptId); + } + + @Override + public List getAimStatisticsData(EduAndDrillDataDTO eduAndDrillDataDTO, List aimDepts, String aimModule) { + return baseMapper.getAimStatisticsData(eduAndDrillDataDTO,aimDepts,aimModule); + } + + /** + * 案件防控任务终止 + */ + private void endPrevent(TaskDTO task) { + if ("prevent".equals(task.getModule())) { + List preventList = preventMaterialService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(task.getId()), PreventMaterial::getTaskId, task.getId())); + if (Func.isNotEmpty(preventList)) { + preventList.forEach(item -> { + item.setStatus(TASK_STOP); + }); + preventMaterialService.saveOrUpdateBatch(preventList); + } + } + } + + /** + * 终止检查整改任务 + */ + private void endInspection(TaskDTO task) { + if ("daily".equals(task.getModule())) { + List inspectionList = inspectionService.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(task.getId()), Inspection::getTaskId, task.getId())); + if (Func.isNotEmpty(inspectionList)) { + inspectionList.forEach(item -> { + item.setStatus(Constant.TASK_STOP_INSPECTION); + }); + inspectionService.saveOrUpdateBatch(inspectionList); + } + } + } + + /** + * 终止教育培训任务或应急演练培训任务 + */ + private void endTaskIn(TaskDTO task) { + if ("edu".equals(task.getModule()) || "drill".equals(task.getModule())) { + List taskInList = this.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(task.getId()), TaskHandin::getTaskId, task.getId()).eq(Func.isNotEmpty(task.getModule()), TaskHandin::getModule, task.getModule())); + if (Func.isNotEmpty(taskInList)) { + taskInList.forEach(item -> { + item.setStatus(Constant.TASK_STOP); + }); + this.saveOrUpdateBatch(taskInList); + } + } + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/service/impl/TaskServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/task/service/impl/TaskServiceImpl.java new file mode 100644 index 0000000..556f135 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/service/impl/TaskServiceImpl.java @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.common.service.IFileService; +import org.security.trans.task.dto.TaskDTO; +import org.security.trans.task.entity.Task; +import org.security.trans.task.mapper.TaskMapper; +import org.security.trans.task.service.ITaskService; +import org.security.trans.task.vo.TaskVO; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.StringUtil; +import org.security.system.entity.Role; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 任务-任务下发 服务实现类 + * + * @author BladeX + * @since 2022-03-10 + */ +@Service +@Slf4j +@AllArgsConstructor +public class TaskServiceImpl extends ServiceImpl implements ITaskService { + + private final IFileService fileService; + private final IDepartmentService departmentService; + + @Override + public IPage selectTaskPage(IPage page, TaskDTO task) { + List taskList = baseMapper.selectTaskPage(page,task); + List vos = new ArrayList<>(); + if(taskList.size()>0){ + taskList.forEach(item->{ + TaskVO taskVO = Func.copy(item,TaskVO.class); + //创建人名称 + taskVO.setCreatedByName(fileService.getUserNameById(taskVO.getCreatedBy())); + //更新人名称 + taskVO.setUpdatedByName(fileService.getUserNameById(taskVO.getUpdatedBy())); + //发布人名称 + taskVO.setPublisherName(fileService.getUserNameById(taskVO.getPublisher())); + vos.add(taskVO); + }); + } + return page.setRecords(vos); + } + + @Override + public TaskVO getDetail(String id) { + TaskVO taskVO = new TaskVO(); + if (Func.isNotEmpty(id)) { + Task detail = super.getById(id); + taskVO = Func.copy(detail, TaskVO.class); + if (Func.isNotEmpty(taskVO)) { + //如果是内部检查,给检查机构赋名称 + if ("daily".equals(taskVO.getModule()) && "2".equals(taskVO.getCheckType())) { + taskVO.setInspectDepName(departmentService.getById(taskVO.getInspectDep()).getDeptName()); + } + taskVO.setFileList(fileService.getAttachments(detail.getId(), detail.getGroupName())); + } + //创建人名称 + taskVO.setCreatedByName(fileService.getUserNameById(taskVO.getCreatedBy())); + //更新人名称 + taskVO.setUpdatedByName(fileService.getUserNameById(taskVO.getUpdatedBy())); + //发布人名称 + taskVO.setPublisherName(fileService.getUserNameById(taskVO.getPublisher())); + } + return taskVO; + } + @Override + public R saveTask(TaskDTO taskDTO){ + Task task = BeanUtil.copyProperties(taskDTO, Task.class); + if (Func.isNull(task.getDeptId()) || Func.isBlank(task.getDeptId())) { + task.setDeptId(String.valueOf(AuthUtil.getDeptId())); + } + if(Func.isNull(task.getNum()) || Func.isBlank(task.getNum())){ + //任务编号 + task.setNum(Constant.TASK_PREFIX + (new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()))); + } + super.saveOrUpdate(task); + List fileList = taskDTO.getFileList(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, task.getId()); + } + return R.success("操作成功"); + } + + @Override + public List getTaskCheckList(String frequency, String state, Date beginDate, Date endDate) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(StringUtil.isNotBlank(frequency), "FREQUENCY", frequency); + queryWrapper.eq(StringUtil.isNotBlank(state), "STATE", state); + queryWrapper.le(beginDate != null, "BEGIN_DATE", beginDate); + queryWrapper.ge(endDate != null, "END_DATE", endDate); + return baseMapper.selectList(queryWrapper); + } + @Override + public List getTaskOvertimeList(String state, Date endDate) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(StringUtil.isNotBlank(state), "STATE", state); + queryWrapper.lt(endDate != null, "END_DATE", endDate); + return baseMapper.selectList(queryWrapper); + } + + @Override + public List getRoleList() { + return baseMapper.selectRoleList(); + } + + @Override + public boolean reopenEmployee(){ + List empNoList = baseMapper.selectReopenEmployee(); + if(empNoList.size()>0){ + log.info("========需重启用的员工:【{}】",empNoList); + empNoList.forEach(item->{ + baseMapper.updateReopenEmployee(item); + }); + } + List userCodeList = baseMapper.selectReopenUser(); + if(userCodeList.size()>0){ + log.info("========需重启用的用户:【{}】",userCodeList); + userCodeList.forEach(item->{ + baseMapper.updateReopenUser(item); + }); + } + return empNoList.size()>0; + } + + @Override + public boolean reopenDept() { + List deptNoList = baseMapper.selectReopenDept(); + if (deptNoList.size() > 0) { + log.info("========需重启用的dept:【{}】",deptNoList); + deptNoList.forEach(item -> { + baseMapper.updateReopenDept(item); + }); + } + List departmentNoList = baseMapper.selectReopenDepartment(); + if (departmentNoList.size() > 0) { + log.info("========需重启用的department:【{}】",departmentNoList); + departmentNoList.forEach(item -> { + baseMapper.updateReopenDepartment(item); + }); + } + return deptNoList.size()>0; + } +} + diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskHandinVO.java b/security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskHandinVO.java new file mode 100644 index 0000000..22caf51 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskHandinVO.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.common.Constant; +import org.security.flow.core.constant.ProcessConstant; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.task.entity.TaskHandin; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.AesUtil; +import org.springblade.core.tool.utils.Func; + +import java.util.List; + +import static org.security.common.Constant.TASK_HANDIN_STATE_DRAFT; +import static org.security.common.Constant.TASK_HANDIN_STATE_DRAFT_OVERTIME; + +/** + * 任务-任务提报视图实体类 + * + * @author BladeX + * @since 2022-03-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "TaskHandinVO对象", description = "任务-任务提报") +public class TaskHandinVO extends TaskHandin { + private static final long serialVersionUID = 1L; + // 提报机构名称 + private String deptName; + // 关联的任务名称 + private String taskName; + // 是否可编辑 + private boolean editable; + // 是否可删除 + private boolean deletable; + + @ApiModelProperty(value = "附件list") + private List fileList; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + public boolean isEditable() { + if ((TASK_HANDIN_STATE_DRAFT.equals(this.getStatus()) || TASK_HANDIN_STATE_DRAFT_OVERTIME.equals(this.getStatus()) || Constant.HANDIN_STATE_REFUSE.equals(this.getState()) || ProcessConstant.CANCEL_STATE.equals(this.getState())) + && (AuthUtil.getUser().getRoleId().contains(String.valueOf(this.getRoleId())) || this.getUserId().contains(String.valueOf(AuthUtil.getUserId())))) { + return true; + } + return false; + } + + + public boolean isDeletable() { + if (((TASK_HANDIN_STATE_DRAFT.equals(this.getStatus()) || TASK_HANDIN_STATE_DRAFT_OVERTIME.equals(this.getStatus())) && Func.isEmpty(this.getDeadline()) && this.getCreatedBy().contains(String.valueOf(AuthUtil.getUserId()))) || Constant.HANDIN_STATE_REFUSE.equals(this.getState())) { + return true; + } + return false; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskTodoVO.java b/security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskTodoVO.java new file mode 100644 index 0000000..b279604 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskTodoVO.java @@ -0,0 +1,23 @@ +package org.security.trans.task.vo; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.security.trans.task.entity.TaskTodo; + +import java.util.Date; + +/** + * @author Created by yzy + * @date 2022/4/22 14:20 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "TaskTodoVO对象", description = "任务-待办事项") +public class TaskTodoVO extends TaskTodo { + + /** + * 创建时间 + */ + private Date updateTime; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskVO.java b/security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskVO.java new file mode 100644 index 0000000..50a7b91 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/task/vo/TaskVO.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.security.trans.task.vo; + +import io.swagger.annotations.ApiModelProperty; +import org.security.ht.vo.common.UploadVO; +import org.security.trans.task.entity.Task; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +import java.util.List; + +/** + * 任务-任务下发视图实体类 + * + * @author BladeX + * @since 2022-03-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "TaskVO对象", description = "任务-任务下发") +public class TaskVO extends Task { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "附件list") + private List fileList; + @ApiModelProperty(value = "检查机构名称") + private String inspectDepName; + @ApiModelProperty(value = "创建人名称") + private String createdByName; + @ApiModelProperty(value = "更新人名称") + private String updatedByName; + @ApiModelProperty(value = "发布人名称") + private String publisherName; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/TaskCheckController.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/TaskCheckController.java new file mode 100644 index 0000000..533b3fa --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/TaskCheckController.java @@ -0,0 +1,86 @@ +package org.security.trans.taskCheck; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.trans.taskCheck.device.DeviceCheckTask; +import org.security.trans.taskCheck.device.DeviceDeadlineCheckTask; +import org.security.trans.taskCheck.task.TaskCheckTask; +import org.security.trans.taskCheck.task.TaskDeadlineCheckTask; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.text.ParseException; + +/** + * @author zj 2022/4/13 + */ +@Api(value = "任务-定时任务", tags = "任务-定时任务") +@AllArgsConstructor +@RequestMapping("/task") +@RestController +public class TaskCheckController { + + private final TaskCheckTask taskCheckTask; + private final TaskDeadlineCheckTask taskDeadlineCheckTask; + private final DeviceCheckTask deviceCheckTask; + private final DeviceDeadlineCheckTask deviceDeadlineCheckTask; + + @ApiOperationSupport(order = 1) + @ApiOperation(value = "生成下发任务") + @GetMapping("/task/check/run") + public void check() { + taskCheckTask.check(); + } + + @ApiOperationSupport(order = 2) + @ApiOperation(value = "检查是否超时") + @GetMapping("/task/deadline/run") + public void deadline() throws ParseException { + taskDeadlineCheckTask.deadlineCeheck(); + } + + @ApiOperationSupport(order = 3) + @ApiOperation(value = "设备检查是否超时") + @GetMapping("/device/deadline/run") + public void deviceDeadline() throws ParseException { + deviceDeadlineCheckTask.deviceDeadlineCheck(); + } + + @ApiOperationSupport(order = 4) + @ApiOperation(value = "生成设备检查任务") + @GetMapping("/device/check/run") + public void deviceCehck() { + deviceCheckTask.check(); + } + + @ApiOperationSupport(order = 5) + @ApiOperation(value = "生成设备使用状态检查任务") + @GetMapping("/device/usageState/run") + public void deviceUsageCheck() throws ParseException{ + deviceDeadlineCheckTask.deviceUsageStateCheck(); + } + + @ApiOperationSupport(order = 6) + @ApiOperation(value = "生成工作提醒状态检查任务") + @GetMapping("/noteRemind/state/run") + public void noteRemindStateCheck() throws ParseException{ + deviceDeadlineCheckTask.deviceUsageStateCheck(); + } + + @ApiOperationSupport(order = 7) + @ApiOperation(value = "检查并终止已到期任务") + @GetMapping("/task/overtime/run") + public void checkOvertime() throws ParseException{ + taskCheckTask.checkOvertime(); + } + + @ApiOperationSupport(order = 8) + @ApiOperation(value = "设备类型变更处理设备检查记录") + @GetMapping("/device/typeChange/run") + public void deviceTypeChange() { + deviceCheckTask.checkDeviceTypeChange(); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/busi/NoteRemindCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/busi/NoteRemindCheck.java new file mode 100644 index 0000000..42addac --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/busi/NoteRemindCheck.java @@ -0,0 +1,50 @@ +package org.security.trans.taskCheck.busi; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.util.DataFormatUtil; +import org.security.ht.entity.basic.Device; +import org.security.trans.applyAndReport.entity.NoteRemind; +import org.security.trans.applyAndReport.service.INoteRemindService; +import org.springblade.core.tool.utils.Func; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author nantian.yangzhengyu + * @date 2023/1/5 16:08 + */ +@Slf4j +@Component +@AllArgsConstructor +public class NoteRemindCheck { + private final INoteRemindService noteRemindService; + /** + *检查工作提醒是否超过提醒结束日期 + */ + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.remindNoteOvertimeCron}") + public void noteRemindStateCheck() throws ParseException { + log.info("=============【定时任务】检查工作提醒是否超过提醒结束日期开始处理============="); + List noteReminds = noteRemindService.getUsingList(); + ArrayList noteRemindsChecks = new ArrayList<>(); + Date today = DataFormatUtil.getLocalDate(); + if (Func.isNotEmpty(noteReminds)) { + noteReminds.forEach(item -> { + if (Func.isNotEmpty(item.getEndTime()) && today.after(item.getEndTime())) { + item.setState(Constant.REMINDER_STATE_END); + noteRemindsChecks.add(item); + } + }); + noteRemindService.updateBatchById(noteRemindsChecks); + } + log.info("=============检查【工作提醒是否超过提醒结束日期】 处理结束============="); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceCheck.java new file mode 100644 index 0000000..c701ebc --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceCheck.java @@ -0,0 +1,281 @@ +package org.security.trans.taskCheck.device; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.eum.FrequencyEnum; +import org.security.common.util.TaskCehckUtil; +import org.security.system.user.vo.UserVO; +import org.security.ht.entity.basic.Device; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.basic.service.IDeviceService; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dailyDuties.entity.DeviceInspectionLine; +import org.security.trans.dailyDuties.service.IDeviceInspectionLineService; +import org.security.trans.dailyDuties.service.IDeviceInspectionService; +import org.security.trans.settings.entity.DeviceCategorySettings; +import org.security.trans.settings.entity.DeviceInspectionSettings; +import org.security.trans.settings.service.IDeviceCategorySettingsService; +import org.security.trans.settings.service.IDeviceInspectionSettingsService; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.*; + +import static org.security.common.Constant.DEVICE_LINE_STATE_0; + +/** + * @author zj 2022/4/26 + * 设备检查 + */ +@Slf4j +@AllArgsConstructor +@Service +public class DeviceCheck { + private static final int NUMS = 1000; + private final IDepartmentService departmentService; + private final IDeviceService deviceService; + private final IDeviceInspectionService deviceInspectionService; + private final IDeviceInspectionLineService deviceInspectionLineService; + private final IDeviceCategorySettingsService deviceCategorySettingsService; + private final IDeviceInspectionSettingsService deviceInspectionSettingsService; + + /** + * 分页查询需要生成检查任务的设备进行处理, + */ + public void handle() { + log.info("=============设备检查任务生成 开始处理============="); + DateTime date = DateUtil.date(); + int cueernt = 0; + Query query = new Query(); + query.setCurrent(cueernt); + query.setSize(NUMS); + IPage deviceIPage = deviceService.getCheckList(query); + log.info("=============当前页码:[{}],总页数:[{}]=============", cueernt, deviceIPage.getPages()); + List deviceList = Optional.ofNullable(deviceIPage.getRecords()).orElse(Collections.emptyList()); + deviceCheck(date, deviceList); + if (deviceIPage.getPages() > 1) { + while (cueernt < deviceIPage.getPages()) { + query.setCurrent(++cueernt); + IPage checkList = deviceService.getCheckList(query); + log.info("=============当前页码:[{}],总页数:[{}]=============", cueernt, deviceIPage.getPages()); + deviceCheck(date, checkList.getRecords()); + } + } + + } + private String getDeviceFrequency(Device device){ +// 获取设备所属类型全路径 + List typeIds = Arrays.asList(device.getTypeRank().split(",")); + if(typeIds.size()>0){ + Collections.reverse(typeIds); + for (String id:typeIds){ + DeviceCategorySettings deviceCategorySettings = deviceCategorySettingsService.getDetailById(id); + if(Func.isNotEmpty(deviceCategorySettings) && Func.isNotEmpty(deviceCategorySettings.getCheckFreq())){ + return deviceCategorySettings.getCheckFreq(); + } + } + } +// 原方法:先找设备device的检查频率值,没有再去查询对应类型的检查频率 +// if(Func.isNotEmpty(device.getFrequency())){ +// return device.getFrequency(); +// }else{ +// DeviceCategorySettings deviceCategorySettings = deviceCategorySettingsService.getDetailById(device.getTypeId()); +// if(Func.isNotEmpty(deviceCategorySettings) && Func.isNotEmpty(deviceCategorySettings.getCheckFreq())){ +// device.setFrequency(deviceCategorySettings.getCheckFreq()); +// deviceService.updateById(device); +// return deviceCategorySettings.getCheckFreq(); +// } +// } + return null; + } + + private void deviceCheck(Date date, List deviceList) { + ArrayList list = new ArrayList<>(); + for (Device device : deviceList) { +// 由于设备检查任务在移动端需要机构下全员可见,因此发布任务时无需指定检查人,也无需根据设备的角色查询对应人员 设备的roleId信息实际未发生作用 +// List userRole = iInspectionService.getUserByRoleId(device.getRoleId(), device.getDepId()); + List userRole = null; + String freq = getDeviceFrequency(device); + FrequencyEnum frequency = FrequencyEnum.wrapper(freq); +// FrequencyEnum frequency = FrequencyEnum.wrapper(device.getFrequency()); + //按天 + switch (frequency) { + case BY_DAY: + byDayCheck(date, device, userRole, list); + break; + case BY_WEEK: + byWeekCheck(date, device, userRole, list); + break; + case BY_MONTH: + byMonthCheck(date, device, userRole, list); + break; + case BY_QUARTER: + byQuarterCheck(date, device, userRole, list); + break; + case BY_HALFYEAR: + byHalfYearCehck(date, device, userRole, list); + break; + case BY_YEAR: + byYearCheck(date, device, userRole, list); + break; + default: + unknowCheck(); + break; + } + } + if (!list.isEmpty()) { + deviceInspectionService.saveBatch(list); + log.info("-------------本次生成设备检查【{}】条",list.size()); + log.info("-------------生成设备检查明细 开始------------"); + list.forEach((ins)->{ + genDeviceCheckLine(ins); + }); + log.info("-------------生成设备检查明细 结束------------"); + } + } + + private void byDayCheck(Date date, Device device, List userRole, ArrayList list) { + log.info("=============设备检查[按天]开始处理============="); + DateTime begin = DateUtil.beginOfDay(date); + DateTime end = DateUtil.endOfDay(date); + checkDevice(device, begin, end, userRole, list); + log.info("=============设备检查[按天]处理结束============="); + } + + private void byWeekCheck(Date date, Device device, List userRole, ArrayList list) { + log.info("=============设备检查[按周]开始处理============="); + DateTime begin = DateUtil.beginOfWeek(date,true); + DateTime end = DateUtil.endOfWeek(date,true); + checkDevice(device, begin, end, userRole, list); + log.info("=============设备检查[按周]处理结束============="); + } + + private void byMonthCheck(Date date, Device device, List userRole, ArrayList list) { + log.info("=============设备检查[按月]开始处理============="); + DateTime begin = DateUtil.beginOfMonth(date); + DateTime end = DateUtil.endOfMonth(date); + checkDevice(device, begin, end, userRole, list); + log.info("=============设备检查[按月]处理结束============="); + } + + private void byQuarterCheck(Date date, Device device, List userRole, ArrayList list) { + log.info("=============设备检查[按季]开始处理============="); + DateTime begin = DateUtil.beginOfQuarter(date); + DateTime end = DateUtil.endOfMonth(date); + checkDevice(device, begin, end, userRole, list); + log.info("=============设备检查[按季]处理结束============="); + } + + private void byHalfYearCehck(Date date, Device device, List userRole, ArrayList list) { + log.info("=============设备检查[按半年]开始处理============="); + Date begin = TaskCehckUtil.getHalfYearStart(); + Date end = TaskCehckUtil.getHalfYearEnd(); + checkDevice(device, begin, end, userRole, list); + log.info("=============设备检查[按半年]处理结束============="); + } + + private void byYearCheck(Date date, Device device, List userRole, ArrayList list) { + log.info("=============设备检查[按年]开始处理============="); + DateTime begin = DateUtil.beginOfYear(date); + DateTime end = DateUtil.endOfYear(date); + checkDevice(device, begin, end, userRole, list); + log.info("=============设备检查[按年]处理结束============="); + } + + private void unknowCheck() { + log.info("=============设备检查[未知]不做处理============="); + } + + private void checkDevice(Device device, Date begin, Date end, List userRole, ArrayList list) { + List deviceInsList = deviceInspectionService.getDeviceIns(device.getId(), begin, end); + if (deviceInsList.size()>0) { + log.info("===========已生成设备检查任务,不做处理============="); + return; + } + DeviceInspection deviceInspection = new DeviceInspection(); + deviceInspection.setDeviceId(device.getId()); + deviceInspection.setDeviceName(device.getName()); + deviceInspection.setDeviceModelNum(device.getModelNum()); + deviceInspection.setCreateDeptId(device.getDepId()); +// 由于设备检查在移动端需要机构全员可见,因此发起任务时无需指定检查人 +// String ids = userRole.stream().map(vo -> String.valueOf(vo.getId())).collect(Collectors.joining(",")); +// deviceInspection.setInspectUser(ids); + deviceInspection.setStatus(Constant.DEVICE_STATE_INSPECTION); + deviceInspection.setState(Constant.HANDIN_STATE_DRAFT); + deviceInspection.setDeptId(device.getDepId()); + deviceInspection.setDeptName(departmentService.getById(deviceInspection.getDeptId()).getDeptName()); + deviceInspection.setCheckDeadline(end); + deviceInspection.setDeviceType(device.getTypeId()); + list.add(deviceInspection); + } + /** + * 查询设备检查项并生成设备检查明细 + */ + private void genDeviceCheckLine(DeviceInspection deviceInspection) { + List deviceInspectionLineList = new ArrayList<>(); + Device item = deviceService.getDeviceById(Long.valueOf(deviceInspection.getDeviceId())); + List typeIds = Func.toStrList(item.getTypeRank()); + List itemInspectionLineList = new ArrayList<>();//记录仅当前设备的检查项 + //根据设备类型层级,循环查询设备检查项表 + typeIds.forEach(typeId -> { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(DeviceInspectionSettings::getDeviceCatgId, typeId); + //获取设备检查项 + List settingsList = deviceInspectionSettingsService.list(queryWrapper); + if(settingsList.size()>0){ + settingsList.forEach(setting -> { + DeviceInspectionLine deviceInspectionLine = new DeviceInspectionLine(); + deviceInspectionLine.setFormId(deviceInspection.getId()); + deviceInspectionLine.setName(setting.getName()); + deviceInspectionLine.setDeviceState(DEVICE_LINE_STATE_0); + deviceInspectionLine.setStatus(Constant.DEVICE_STATE_INSPECTION); + deviceInspectionLine.setState(Constant.HANDIN_STATE_DRAFT); + deviceInspectionLine.setDeptId(deviceInspection.getDeptId()); + deviceInspectionLine.setDeptName(deviceInspection.getDeptName()); + deviceInspectionLine.setProblemLevel(Constant.DEVICE_PROBLEM_NORMAL);//设备检查的各检查项项默认检查结果为:1-正常 + itemInspectionLineList.add(deviceInspectionLine); + deviceInspectionLineList.add(deviceInspectionLine); + }); + } + }); + + if(itemInspectionLineList.size()<1){ + log.info("-----当前设备【{}-{}】无法查询到对应的设备检查项",item.getName(),item.getId()); + log.info("-----需要将已生成的设备检查主表对应记录删除"); + deviceInspectionService.removeById(deviceInspection.getId()); + } + deviceInspectionLineService.saveBatch(itemInspectionLineList); + } + + /** + * 查询需要变更设备类型的【设备检查t_device_inspection】记录进行处理 + */ + public void handleDeviceTypeChange() { + log.info("=============设备类型变更关联设备检查对应字段变更 开始处理============="); + List deviceInspectionList = deviceInspectionService.getTypeChangeList(); + if (deviceInspectionList.size() > 0) { + deviceInspectionList.forEach(item->{ + Device d = deviceService.getDeviceById(Long.valueOf(item.getDeviceId())); + if(Func.isNotEmpty(d)){ + item.setDeviceType(d.getTypeId()); + deviceInspectionService.updateById(item); + } + }); + } +// 同时处理state为null的数据:因原本的定时任务生成了废数据,移动端收不到,需要清除 + List deviceInspectionList2 = deviceInspectionService.getStateNullList(); + if (deviceInspectionList2.size() > 0) { + log.info("=============待清理state为null的设备检查数据【{}】条=============",deviceInspectionList2.size()); + deviceInspectionList2.forEach(item->{ + deviceInspectionService.removeById(item.getId()); + }); + } + log.info("=============设备类型变更关联设备检查对应字段变更 处理数据【{}】条=============",deviceInspectionList.size()); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceCheckTask.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceCheckTask.java new file mode 100644 index 0000000..70c656d --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceCheckTask.java @@ -0,0 +1,31 @@ +package org.security.trans.taskCheck.device; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +/** + * @author zj 2022/4/27 + */ +@Component +@Slf4j +@AllArgsConstructor +public class DeviceCheckTask { + private final DeviceCheck deviceCheck; + + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.deviceInspectionCron}") + public void check(){ + log.info("=============【定时任务】自动生成设备检查任务开始处理============="); + deviceCheck.handle(); + } + + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.deviceCatgChangeCron}") + public void checkDeviceTypeChange(){ + log.info("=============【定时任务】设备类型变更关联设备检查对应字段变更开始处理============="); + deviceCheck.handleDeviceTypeChange(); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceDeadlineCheckTask.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceDeadlineCheckTask.java new file mode 100644 index 0000000..cb375f5 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/device/DeviceDeadlineCheckTask.java @@ -0,0 +1,81 @@ +package org.security.trans.taskCheck.device; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.util.DataFormatUtil; +import org.security.ht.entity.basic.Device; +import org.security.trans.basic.service.IDeviceService; +import org.security.trans.dailyDuties.entity.DeviceInspection; +import org.security.trans.dailyDuties.service.IDeviceInspectionService; +import org.springblade.core.tool.utils.Func; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author zj 2022/4/27 + */ +@Slf4j +@Component +@AllArgsConstructor +public class DeviceDeadlineCheckTask { + private final IDeviceInspectionService deviceInspectionService; + private final IDeviceService deviceService; + + /** + * 检查设备检查任务是否超时 + */ + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.deviceInspOvertimeCron}") + public void deviceDeadlineCheck() throws ParseException { + log.info("=============【定时任务】设备检查是否超时任务开始处理============="); + List deadlineCheckList = deviceInspectionService.getDeadlineCheckList(); + if (deadlineCheckList.isEmpty()) { + log.info("=============没有设备正在检查============="); + return; + } + Date today = DataFormatUtil.getLocalDate(); + if (Func.isNotEmpty(deadlineCheckList)) { + ArrayList list = new ArrayList<>(); + deadlineCheckList.forEach(deviceInspection -> { + Date deadline = deviceInspection.getCheckDeadline(); + if (Func.isNotEmpty(deadline)) { + if (today.after(deadline)) { + deviceInspection.setStatus(Constant.DEVICE_STATE_OVERTIME_INSPECTION); + list.add(deviceInspection); + } + } + }); + deviceInspectionService.updateBatchById(list); + } + log.info("=============设备检查是否超时任务处理结束============="); + } + + /** + *检查设备是否超过维保期限使用中 + */ + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.deviceOvertimeCron}") + public void deviceUsageStateCheck() throws ParseException{ + log.info("=============【定时任务】检查设备是否超维保期限使用 开始处理============="); + List deviceList = deviceService.getUsingList(); + ArrayList DeviceChecks = new ArrayList<>(); + Date today = DataFormatUtil.getLocalDate(); + if (Func.isNotEmpty(deviceList)){ + deviceList.forEach(item ->{ + if (Func.isNotEmpty(item.getMaintenanceDate()) && today.after(item.getMaintenanceDate())){ + item.setUsageState(Constant.DEVICE_STATE_OVERTIME_USE); + DeviceChecks.add(item); + } + }); + deviceService.updateBatchById(DeviceChecks); + } + log.info("=============检查设备是否超维保期限使用 处理结束============="); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/ITaskCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/ITaskCheck.java new file mode 100644 index 0000000..36d679a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/ITaskCheck.java @@ -0,0 +1,21 @@ +package org.security.trans.taskCheck.task; + +import org.security.common.eum.FrequencyEnum; +import org.security.trans.task.entity.Task; + +/** + * @author zj 2022/4/11 + */ +public interface ITaskCheck { + /** + * 处理 + */ + void handle(Task task); + + /** + * 支持类型 + * + * @return TaskCheckEnum + */ + boolean support(FrequencyEnum frequencyEnum); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskCheckFactory.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskCheckFactory.java new file mode 100644 index 0000000..a11ebe1 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskCheckFactory.java @@ -0,0 +1,39 @@ +package org.security.trans.taskCheck.task; + +import org.security.common.eum.FrequencyEnum; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @author zj 2022/4/11 + * 根据类型获取对应 + */ +@Component +public class TaskCheckFactory implements ApplicationContextAware { + private static ApplicationContext context; + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + context = applicationContext; + } + + /** + * 获取对应taskCheck + * + * @param frequencyEnum 类型 + * @return ITaskCheck + */ + public static ITaskCheck getTaskCheck(FrequencyEnum frequencyEnum) { + Map map = context.getBeansOfType(ITaskCheck.class); + for (ITaskCheck taskCheck : map.values()) { + if (taskCheck.support(frequencyEnum)) { + return taskCheck; + } + } + return (ITaskCheck) context.getBean("unknowTaskCheck"); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskCheckTask.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskCheckTask.java new file mode 100644 index 0000000..a85df27 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskCheckTask.java @@ -0,0 +1,92 @@ +package org.security.trans.taskCheck.task; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.eum.FrequencyEnum; +import org.security.common.util.DataFormatUtil; +import org.security.trans.task.dto.TaskDTO; +import org.security.trans.task.entity.Task; +import org.security.trans.task.service.ITaskService; +import org.springblade.core.tool.utils.BeanUtil; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.text.ParseException; +import java.util.Date; +import java.util.List; + +/** + * @author zj 2022/4/13 + */ +@Slf4j +@AllArgsConstructor +@Component +public class TaskCheckTask { + private final ITaskService taskService; + + /** + * 检查任务提报状态 + * 检查各个该提报机构是否按时提报, + * 若未提报,则生成对应超时未提报记录 + */ + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.taskPublishCron}") + public void check() { + log.info("===============【定时任务】任务发布开始执行==============="); + List taskList = taskService.getTaskCheckList(null, Constant.TASK_STATE_PUBLISH, null, null); + if (taskList.isEmpty()) { + log.info("===============不存在状态为[已发布]的任务列表"); + return; + } + taskList.forEach(task -> { + ITaskCheck taskCheck = TaskCheckFactory.getTaskCheck(FrequencyEnum.wrapper(task.getFrequency())); + taskCheck.handle(task); + }); + log.info("===============任务检查执行完成==============="); + } + + /** + * 检查已到期的任务并将其终止 + */ + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.taskExpireCron}") + public void checkOvertime() throws ParseException{ + log.info("===============【定时任务】任务到期终止开始执行==============="); + Date today = DataFormatUtil.getLocalDate(); + List taskList = taskService.getTaskOvertimeList(Constant.TASK_STATE_PUBLISH, today); + if (taskList.isEmpty()) { + log.info("===============不存在[已发布且已到期]的任务列表"); + return; + } + taskList.forEach(task -> { + task.setState(Constant.TASK_STATE_END); + task.setReserve4("任务到期自动终止"); + TaskDTO taskDTO = BeanUtil.copyProperties(task, TaskDTO.class); + taskService.saveTask(taskDTO); + }); + log.info("===============任务到期终止执行完成==============="); + } + + /** + * 存在员工禁用后重新启用的情况,需要查询出t_user_sync_history中启用而blade_user/t_employee禁用的数据,将blade_user/t_employee中的重新启用 + */ + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.reEnableEmplyeeCron}") + public void reopenEmployee(){ + log.info("===============【定时任务】检查禁用后重启用的员工并重启用==============="); + taskService.reopenEmployee(); + log.info("===============员工重启用执行完成==============="); + } + /** + * 考虑机构禁用后重新启用的情况,需要查询出t_dept_sync_history中启用而blade_dept/t_department禁用的数据,将blade_dept/t_department中的重新启用 + */ + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.reEnableDeptCron}") + public void reopenDept(){ + log.info("===============【定时任务】检查禁用后重启用的机构并重启用==============="); + taskService.reopenDept(); + log.info("===============机构重启用执行完成==============="); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskDeadlineCheckTask.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskDeadlineCheckTask.java new file mode 100644 index 0000000..d99fc26 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/TaskDeadlineCheckTask.java @@ -0,0 +1,164 @@ +package org.security.trans.taskCheck.task; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; +import org.security.common.util.DataFormatUtil; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.prevent.entity.PreventMaterial; +import org.security.trans.prevent.service.IPreventMaterialService; +import org.security.trans.securityCommandCenter.entity.SccUnlocaleCheck; +import org.security.trans.securityCommandCenter.service.ISccUnlocaleCheckService; +import org.security.trans.task.entity.TaskHandin; +import org.security.trans.task.service.ITaskHandinService; +import org.springblade.core.tool.utils.Func; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author zj 2022/4/14 + */ +@Slf4j +@AllArgsConstructor +@Component +public class TaskDeadlineCheckTask { + private final ITaskHandinService taskHandinService; + private final IInspectionService iInspectionService; + private final IPreventMaterialService preventMaterialService; + private final ISccUnlocaleCheckService sccUnlocaleCheckService; + + /** + * 检查提报任务是否超时 + */ + @Async("securityThreadPool") + @Scheduled(cron = "${schedule.taskOvertimeCron}") + public void deadlineCeheck() throws ParseException { + log.info("==============【定时任务】检测提报任务是否超时开始处理=============="); + List taskHandinList = taskHandinService.getTaskList(Constant.TASK_HANDIN_STATE_DRAFT); //待执行的taskHandin记录 + List inspectionList = iInspectionService.getCheckList(Constant.PROBLEM_STATE_DRAFT); //待提交检查的inspection记录 + List inspectionListR = iInspectionService.getCheckList(Constant.PROBLEM_STATE_WAIT_RECTIFY); //待整改的inspection记录 + List preventMaterialsList = preventMaterialService.getPreventList(Constant.TASK_HANDIN_STATE_DRAFT); //待提交的案件防控preventMaterials记录 + //非现场检查整改整改通知书待整改任务 + List sccUnlocaleCheckList = sccUnlocaleCheckService.getListData(Constant.PROBLEM_STATE_DRAFT_ONE); + //警情信息未提报任务数据 +// List sccAlarmPushList = sccAlarmPushService.getListData(Constant.PUSH_STATUS_THREE); + Date today = DataFormatUtil.getLocalDate(); + //教育培训或应急演练任务超期未提报 + updateEduOrDrill(taskHandinList, today); + //检查整改超期未提交检查记录 + setOvertimeCheck(inspectionList, today); + //检查整改记录超期未进行整改提交 + setOvertimeRectification(inspectionListR, today); + //案件防控任务超期未提报 + setOvertimePrevent(preventMaterialsList, today); + //整改通知书超时未提报 + setOvertimeUnlocaleCheck(sccUnlocaleCheckList, today); + //警情信息超时未提报 +// ArrayList alarmPushes = new ArrayList<>(); +// if (Func.isNotEmpty(sccAlarmPushList)){ +// sccAlarmPushList.forEach(item ->{ +// }); +// } + log.info("==============检测提报任务是否超时处理结束=============="); + } + + /** + *整改通知书超时未提报 + */ + private void setOvertimeUnlocaleCheck(List sccUnlocaleCheckList, Date today) { + ArrayList sccUnlocaleChecks = new ArrayList<>(); + if (Func.isNotEmpty(sccUnlocaleCheckList)){ + sccUnlocaleCheckList.forEach(item ->{ + if (Func.isNotEmpty(item.getRectificationDeadline()) && today.after(item.getRectificationDeadline())){ + item.setStatus(Constant.PROBLEM_STATE_FOURE); + sccUnlocaleChecks.add(item); + } + }); + sccUnlocaleCheckService.updateBatchById(sccUnlocaleChecks); + } + } + + /** + * 案件防控任务超期未提报 + */ + private void setOvertimePrevent(List preventMaterialsList, Date today) { + ArrayList list = new ArrayList<>(); + if (Func.isNotEmpty(preventMaterialsList)) { + preventMaterialsList.forEach(item -> { + Date deadline = item.getDeadline(); + if (Func.isNotEmpty(deadline)) { + if (today.after(deadline)) { + item.setStatus(Constant.TASK_HANDIN_STATE_DRAFT_OVERTIME); + list.add(item); + } + } + }); + preventMaterialService.updateBatchById(list); + } + } + + /** + * 检查整改记录超期未进行整改提交 + */ + private void setOvertimeRectification(List inspectionListR, Date today) { + ArrayList list = new ArrayList<>(); + if (Func.isNotEmpty(inspectionListR)) { + inspectionListR.forEach(inspection -> { + Date deadline = inspection.getRectifyDeadline(); + if (Func.isNotEmpty(deadline)) { + if (today.after(deadline)) { + inspection.setStatus(Constant.PROBLEM_STATE_OVERTIME); + list.add(inspection); + } + } + }); + iInspectionService.updateBatchById(list); + } + } + + /** + * 检查整改超期未提交检查记录 + */ + private void setOvertimeCheck(List inspectionList, Date today) { + ArrayList list = new ArrayList<>(); + if (Func.isNotEmpty(inspectionList)) { + inspectionList.forEach(inspection -> { + Date deadline = inspection.getDeadline(); + if (Func.isNotEmpty(deadline)) { + if (today.after(deadline)) { + inspection.setStatus(Constant.PROBLEM_STATE_DRAFT_OVERTIME); + list.add(inspection); + } + } + }); + iInspectionService.updateBatchById(list); + } + } + + /** + * 教育培训或应急演练任务超期未提报 + */ + private void updateEduOrDrill(List taskHandinList, Date today) { + ArrayList list = new ArrayList<>(); + if (Func.isNotEmpty(taskHandinList)) { + taskHandinList.forEach(taskHandin -> { + Date deadline = taskHandin.getDeadline(); + //超时 + if (Func.isNotEmpty(deadline)) { + if (today.after(deadline)) { + taskHandin.setStatus(Constant.TASK_HANDIN_STATE_DRAFT_OVERTIME); + list.add(taskHandin); + } + } + }); + taskHandinService.updateBatchById(list); + } + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/dto/TaskHandinCheckDTO.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/dto/TaskHandinCheckDTO.java new file mode 100644 index 0000000..f40d108 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/dto/TaskHandinCheckDTO.java @@ -0,0 +1,21 @@ +package org.security.trans.taskCheck.task.dto; + +import lombok.Builder; +import lombok.Data; + +import java.util.Date; + +/** + * @author zj 2022/4/12 + */ +@Data +@Builder +public class TaskHandinCheckDTO { + private String taskId; + private String deptId; + private String status; + private Date beginDate; + private Date endDate; + private Date creatStartDate; + private Date creatEndDate; +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/BaseTaskCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/BaseTaskCheck.java new file mode 100644 index 0000000..5ea7c30 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/BaseTaskCheck.java @@ -0,0 +1,190 @@ +package org.security.trans.taskCheck.task.impl; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.Constant; + +import org.security.system.user.vo.UserVO; +import org.security.trans.basic.service.IDepartmentService; +import org.security.trans.dailyDuties.entity.Inspection; +import org.security.trans.dailyDuties.service.IInspectionService; +import org.security.trans.prevent.entity.PreventMaterial; +import org.security.trans.prevent.service.IPreventMaterialService; +import org.security.trans.task.entity.Task; +import org.security.trans.task.entity.TaskHandin; +import org.security.trans.task.service.ITaskHandinService; +import org.security.trans.taskCheck.task.dto.TaskHandinCheckDTO; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author zj 2022/4/11 + */ +@Slf4j +@AllArgsConstructor +@Service +public class BaseTaskCheck { + private final ITaskHandinService taskHandinService; + private final IInspectionService iInspectionService; + private final IPreventMaterialService preventMaterialService; + private final IDepartmentService departmentService; + + public void handle(Task task, Date begin, Date end) { + if (Func.isNotEmpty(task.getBeginDate()) && DateUtil.date().before(task.getBeginDate())) { + log.info("=============任务开始时间: {}=============", task.getBeginDate()); + log.info("=============任务未开始,不做处理============="); + return; + } + if (Func.isNotEmpty(task.getEndDate()) && DateUtil.date().after(task.getEndDate())) { + log.info("=============任务结束时间: {}=============", task.getEndDate()); + log.info("=============任务已经结束,不做处理============="); + return; + } + //获取任务接收的部门id + Long[] deptIds = Func.toLongArray(task.getDeptIds()); + ArrayList taskHandins = new ArrayList<>(); + ArrayList inspections = new ArrayList<>(); + List materialList = new ArrayList<>(); + //业务类型code + String taskBusinessType = task.getBusinessType(); + String module = task.getModule(); + DateTime creatTime = DateUtil.date(); + for (Long deptId : deptIds) { + log.info("=============定时任务生成任务处理-当前机构【{}】=============",deptId); + //获取任务接收机构相关角色的用户信息 + List userList = iInspectionService.getUserByRoleId(task.getRoleId(), String.valueOf(deptId)); + String userIds = ""; + if (Func.isNotEmpty(userList)) { + userIds = userList.stream().map(vo -> String.valueOf(vo.getId())).collect(Collectors.joining(",")); + } + //检查整改 + if ("daily".equals(module)) { + Inspection inspection = iInspectionService.getCheckInspection(task.getId(), String.valueOf(deptId), begin, end); + if (Func.isNotEmpty(inspection)) { + log.info("=============检查整改任务已生成,不做处理============="); + continue; + } + //创建检查整改任务 + setInspectionData(task, end, inspections, creatTime, deptId, userIds); + } + //教育培训或应急演练 + if ("drill".equals(module) || "edu".equals(module)) { + //教育培训或应急演练任务请求条件构造 + TaskHandin taskHandin = setEduOrDrillDataConditon(task, begin, end, deptId); + if (Func.isNotEmpty(taskHandin)) { + if ("drill".equals(taskHandin.getModule())){ + log.info("=============应急演练任务已生成,不做处理============="); + }else { + log.info("=============教育培训任务已生成,不做处理============="); + } + continue; + } + //封装教育培训和应急演练任务信息 + setTaskHandInData(task, end, taskHandins, taskBusinessType, creatTime, deptId, userIds); + } + //案件防控 + if ("prevent".equals(module)) { + PreventMaterial preventMaterial = preventMaterialService.getPreventMaterialDatas(task.getId(), String.valueOf(deptId), begin, end); + if (Func.isNotEmpty(preventMaterial)) { + log.info("=============案件防控任务已生成,不做处理============="); + continue; + } + //封装案件防控任务信息 + setPreventMaterialData(task, end, materialList, creatTime, deptId, userIds); + } + } + if (!taskHandins.isEmpty()) { + log.info("=============[创建taskHandin任务]开始写表=============="); + taskHandinService.saveBatch(taskHandins); + } + if (!inspections.isEmpty()) { + log.info("=============[创建inspection任务]开始写表=============="); + iInspectionService.saveBatch(inspections); + } + if (Func.isNotEmpty(materialList)){ + log.info("=============[创建preventMaterial任务]开始写表=============="); + preventMaterialService.saveBatch(materialList); + } + } + + private void setPreventMaterialData(Task task, Date end, List materialList, DateTime creatTime, Long deptId, String userIds) { + log.info("=============[创建prevent_material任务]开始赋值=============="); + PreventMaterial material = new PreventMaterial(); + material.setTaskId(task.getId()); + material.setType(task.getBusinessType()); + material.setCreatedTime(creatTime); + material.setDeptId(String.valueOf(deptId)); + material.setDeadline(end); + material.setRoleId(task.getRoleId()); + material.setUserId(userIds); + material.setDeptName(Func.isNotEmpty(departmentService.getById(material.getDeptId()))? + departmentService.getById(material.getDeptId()).getDeptName():""); + material.setStatus("0"); + materialList.add(material); + } + + /** + * 封装教育培训和应急演练任务信息 + */ + private void setTaskHandInData(Task task, Date end, ArrayList taskHandins, String taskBusinessType, DateTime creatTime, Long deptId, String userIds) { + log.info("=============[创建task_handin任务]开始赋值=============="); + TaskHandin handin = new TaskHandin(); + handin.setTaskId(task.getId()); + handin.setFlag(task.getFlag()); + handin.setModule(task.getModule()); + handin.setBusinessType(taskBusinessType); + handin.setStatus(Constant.HANDIN_STATE_DRAFT); + handin.setDeadline(end); + handin.setDeptId(String.valueOf(deptId)); + handin.setDeptName(Func.isNotEmpty(departmentService.getById(String.valueOf(deptId)))? + departmentService.getById(String.valueOf(deptId)).getDeptName():""); + handin.setCreatedTime(creatTime); + handin.setUserId(userIds); + handin.setRoleId(task.getRoleId()); + taskHandins.add(handin); + } + + /** + * 教育培训或应急演练任务请求条件构造 + */ + private TaskHandin setEduOrDrillDataConditon(Task task, Date begin, Date end, Long deptId) { + TaskHandinCheckDTO checkDTO = TaskHandinCheckDTO.builder() + .taskId(task.getId()) + .status(Constant.HANDIN_STATE_DRAFT) + .deptId(String.valueOf(deptId)) + .creatStartDate(begin) + .creatEndDate(end) + .build(); + return taskHandinService.getTaskHandin(checkDTO); + } + + /** + * 创建检查整改任务 + */ + private void setInspectionData(Task task, Date end, ArrayList inspections, DateTime creatTime, Long deptId, String userIds) { + log.info("=============[创建inspection任务]开始赋值=============="); + Inspection ins = new Inspection(); + ins.setUserId(userIds); + ins.setType(task.getFlag()); + ins.setCheckType(task.getCheckType()); + ins.setRoleId(task.getRoleId()); + ins.setTaskId(task.getId()); + ins.setInspectDep(Constant.INSPECTION_TYPE_SELF.equals(task.getCheckType()) ? String.valueOf(deptId) : task.getInspectDep()); + ins.setInspectedDep(String.valueOf(deptId)); + ins.setDeadline(end); + ins.setDeptId(Constant.INSPECTION_TYPE_SELF.equals(task.getCheckType()) ? String.valueOf(deptId) : task.getInspectDep()); + ins.setDeptName(Func.isNotEmpty(departmentService.getById(ins.getDeptId()))? + departmentService.getById(ins.getDeptId()).getDeptName():""); + ins.setModule(task.getModule()); + ins.setBusinessType(task.getBusinessType()); + ins.setCreatedTime(creatTime); + inspections.add(ins); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByDayTaskCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByDayTaskCheck.java new file mode 100644 index 0000000..0213c00 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByDayTaskCheck.java @@ -0,0 +1,38 @@ +package org.security.trans.taskCheck.task.impl; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.eum.FrequencyEnum; +import org.security.trans.task.entity.Task; +import org.security.trans.taskCheck.task.ITaskCheck; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * @author zj 2022/4/11 + * 按天 + */ +@Slf4j +@AllArgsConstructor +@Service +public class ByDayTaskCheck implements ITaskCheck { + private final BaseTaskCheck baseTaskCheck; + + @Override + public void handle(Task task) { + log.info("=============任务类型[按天]开始处理=============="); + DateTime date = DateUtil.date(); + Date startDate = DateUtil.beginOfDay(date); + Date endDate = DateUtil.endOfDay(date); + baseTaskCheck.handle(task, startDate, endDate); + log.info("=============任务类型[按天]处理结束=============="); + } + + @Override + public boolean support(FrequencyEnum frequencyEnum) { + return FrequencyEnum.BY_DAY.equals(frequencyEnum); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByHalfYearTaskCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByHalfYearTaskCheck.java new file mode 100644 index 0000000..31b71d4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByHalfYearTaskCheck.java @@ -0,0 +1,40 @@ +package org.security.trans.taskCheck.task.impl; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.eum.FrequencyEnum; +import org.security.common.util.TaskCehckUtil; +import org.security.trans.task.entity.Task; +import org.security.trans.taskCheck.task.ITaskCheck; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * @author zj 2022/4/11 + * 按半年 + */ +@Slf4j +@AllArgsConstructor +@Service +public class ByHalfYearTaskCheck implements ITaskCheck { + private final BaseTaskCheck baseTaskCheck; + + @Override + public void handle(Task task) { + log.info("=============任务类型[按半年]开始处理=============="); + Date begin = TaskCehckUtil.getHalfYearStart(); + Date end = TaskCehckUtil.getHalfYearEnd(); + baseTaskCheck.handle(task, begin, end); + log.info("=============任务类型[按半年]处理结束=============="); + } + + @Override + public boolean support(FrequencyEnum frequencyEnum) { + return FrequencyEnum.BY_HALFYEAR.equals(frequencyEnum); + } + + + + +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByMonthTaskCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByMonthTaskCheck.java new file mode 100644 index 0000000..2a25eb0 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByMonthTaskCheck.java @@ -0,0 +1,38 @@ +package org.security.trans.taskCheck.task.impl; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.eum.FrequencyEnum; +import org.security.trans.task.entity.Task; +import org.security.trans.taskCheck.task.ITaskCheck; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * @author zj 2022/4/11 + * 按月 + */ +@Slf4j +@AllArgsConstructor +@Service +public class ByMonthTaskCheck implements ITaskCheck { + private final BaseTaskCheck baseTaskCheck; + + @Override + public void handle(Task task) { + log.info("=============任务类型[按月]开始处理=============="); + DateTime date = DateUtil.date(); + Date begin = DateUtil.beginOfMonth(date); + Date end = DateUtil.endOfMonth(date); + baseTaskCheck.handle(task, begin, end); + log.info("=============任务类型[按月]处理结束=============="); + } + + @Override + public boolean support(FrequencyEnum frequencyEnum) { + return FrequencyEnum.BY_MONTH.equals(frequencyEnum); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByQuarterTaskCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByQuarterTaskCheck.java new file mode 100644 index 0000000..b4eb50f --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByQuarterTaskCheck.java @@ -0,0 +1,38 @@ +package org.security.trans.taskCheck.task.impl; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.eum.FrequencyEnum; +import org.security.trans.task.entity.Task; +import org.security.trans.taskCheck.task.ITaskCheck; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * @author zj 2022/4/11 + * 按季 + */ +@Slf4j +@AllArgsConstructor +@Service +public class ByQuarterTaskCheck implements ITaskCheck { + private final BaseTaskCheck baseTaskCheck; + + @Override + public void handle(Task task) { + log.info("=============任务类型[按季]开始处理=============="); + DateTime date = DateUtil.date(); + Date begin = DateUtil.beginOfQuarter(date); + Date end = DateUtil.endOfQuarter(date); + baseTaskCheck.handle(task, begin, end); + log.info("=============任务类型[按季]处理结束=============="); + } + + @Override + public boolean support(FrequencyEnum frequencyEnum) { + return FrequencyEnum.BY_QUARTER.equals(frequencyEnum); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByWeekTaskCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByWeekTaskCheck.java new file mode 100644 index 0000000..9a997a4 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByWeekTaskCheck.java @@ -0,0 +1,39 @@ +package org.security.trans.taskCheck.task.impl; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.eum.FrequencyEnum; +import org.security.trans.task.entity.Task; +import org.security.trans.taskCheck.task.ITaskCheck; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * @author zj 2022/4/11 + * 按周 + */ +@Slf4j +@AllArgsConstructor +@Service +public class ByWeekTaskCheck implements ITaskCheck { + private final BaseTaskCheck baseTaskCheck; + + @Override + public void handle(Task task) { + log.info("=============任务类型[按周]开始处理=============="); + DateTime date = DateUtil.date(); +// 首先明确周一为每周第一天 + Date startDate = DateUtil.beginOfWeek(date,true); + Date endDate = DateUtil.endOfWeek(date,true); + baseTaskCheck.handle(task, startDate, endDate); + log.info("=============任务类型[按周]处理结束=============="); + } + + @Override + public boolean support(FrequencyEnum frequencyEnum) { + return FrequencyEnum.BY_WEEK.equals(frequencyEnum); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByYearTaskCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByYearTaskCheck.java new file mode 100644 index 0000000..4903c0c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/ByYearTaskCheck.java @@ -0,0 +1,38 @@ +package org.security.trans.taskCheck.task.impl; + +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.common.eum.FrequencyEnum; +import org.security.trans.task.entity.Task; +import org.security.trans.taskCheck.task.ITaskCheck; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * @author zj 2022/4/11 + * 按年 + */ +@Slf4j +@AllArgsConstructor +@Service +public class ByYearTaskCheck implements ITaskCheck { + private final BaseTaskCheck baseTaskCheck; + + @Override + public void handle(Task task) { + log.info("=============任务类型[按年]开始处理=============="); + DateTime date = DateUtil.date(); + Date startDate = DateUtil.beginOfYear(date); + Date endDate = DateUtil.endOfYear(date); + baseTaskCheck.handle(task, startDate, endDate); + log.info("=============任务类型[按年]处理结束=============="); + } + + @Override + public boolean support(FrequencyEnum frequencyEnum) { + return FrequencyEnum.BY_YEAR.equals(frequencyEnum); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/UnknowTaskCheck.java b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/UnknowTaskCheck.java new file mode 100644 index 0000000..6a2670a --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/taskCheck/task/impl/UnknowTaskCheck.java @@ -0,0 +1,24 @@ +package org.security.trans.taskCheck.task.impl; + +import lombok.extern.slf4j.Slf4j; +import org.security.common.eum.FrequencyEnum; +import org.security.trans.task.entity.Task; +import org.security.trans.taskCheck.task.ITaskCheck; +import org.springframework.stereotype.Service; + +/** + * @author zj 2022/4/14 + */ +@Slf4j +@Service +public class UnknowTaskCheck implements ITaskCheck { + @Override + public void handle(Task task) { + log.info("=============任务类型[未知],不做处理=============="); + } + + @Override + public boolean support(FrequencyEnum frequencyEnum) { + return FrequencyEnum.UNKNOW.equals(frequencyEnum); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/controller/HandoverHistoryController.java b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/controller/HandoverHistoryController.java new file mode 100644 index 0000000..f559924 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/controller/HandoverHistoryController.java @@ -0,0 +1,57 @@ +package org.security.trans.workHandOverUsers.controller; + +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.security.ht.workHandOverUsers.entity.HandoverHistory; +import org.security.ht.workHandOverUsers.vo.HandoverHistoryVO; +import org.security.ht.workHandOverUsers.dto.HandoverHistoryDTO; +import org.security.trans.workHandOverUsers.service.HandoverHistoryService; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author zj 2022/9/7 + */ +@AllArgsConstructor +@RestController +@RequestMapping("/handover/history") +public class HandoverHistoryController { + private final HandoverHistoryService handoverHistoryService; + + @PostMapping("/save") + public R add(@Valid @RequestBody HandoverHistoryVO handoverHistoryVO) { + handoverHistoryVO.setHandoverTime(DateUtil.date()); + return handoverHistoryService.saveForm(handoverHistoryVO); + } + + /** + * 自定义分页 工作交接历史 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入HandoverHistoryDTO") + public R> page(HandoverHistoryDTO handoverHistoryDTO, Query query) { + IPage pages = handoverHistoryService.selectProjectPage(Condition.getPage(query), handoverHistoryDTO); + return R.data(pages); + } + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + HandoverHistory handoverHistory = handoverHistoryService.getDetail(id); + return R.data(Func.copy(handoverHistory,HandoverHistoryVO.class)); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/controller/WorkHandoverUsersController.java b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/controller/WorkHandoverUsersController.java new file mode 100644 index 0000000..1191513 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/controller/WorkHandoverUsersController.java @@ -0,0 +1,108 @@ +package org.security.trans.workHandOverUsers.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.security.desk.feign.IFaceClient; +import org.security.desk.vo.FaceVO; +import org.security.ht.workHandOverUsers.entity.WorkHandoverUsers; +import org.security.ht.workHandOverUsers.vo.WorkHandoverCheckVO; +import org.security.ht.workHandOverUsers.vo.WorkHandoverUsersVO; +import org.security.ht.workHandOverUsers.dto.WorkHandoverUsersDTO; +import org.security.trans.workHandOverUsers.service.IWorkHandoverUsers; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; + +/** + * @author :wzf + * @apiNote :工作交接用户信息 + * @since :Created in 2022/9/2 16:40 + */ +@AllArgsConstructor +@RestController +@RequestMapping("/work/handover") +public class WorkHandoverUsersController { + private final IWorkHandoverUsers workHandoverUsersService; + private final IFaceClient faceClient; + + /** + * 工作交接校验 + * + * @return + */ + @PostMapping("/check") + public R workHandoverCheck(@Valid @RequestBody WorkHandoverCheckVO workHandoverCheckVO) { + return workHandoverUsersService.workHandoverCheck(workHandoverCheckVO); + } + + @GetMapping("/detail/{idCard}") + public R getByIdCard(@PathVariable String idCard) { + return R.data(workHandoverUsersService.getByIdCard(idCard)); + } + + + /** + * 工作交接人员信息录入 + * @param workHandoverUsersDTO + * @return + */ + @PostMapping("/save") + public R add(@Valid @RequestBody WorkHandoverUsersDTO workHandoverUsersDTO) { + return R.status(workHandoverUsersService.saveData(workHandoverUsersDTO)); + } + + /** + * 工作交接人员信息录入(连同人脸录入) + */ + @PostMapping("/save-with-face") + public R addWithFaceInfo(@RequestPart("faceVo") FaceVO faceVO, @RequestPart("file") MultipartFile file) { + return workHandoverUsersService.saveWithFace(faceVO, file); + } + + /** + * 工作交接人员人脸比对 + */ + @PostMapping("/face-match") + public R faceMatch(@RequestPart("file") MultipartFile file) { + return faceClient.faceMatch(file); + } + + /** + * 自定义分页 工作交接用户列表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入workHandoverUsersDTO") + public R> page(WorkHandoverUsersDTO workHandoverUsersDTO, Query query) { + IPage pages = workHandoverUsersService.selectProjectPage(Condition.getPage(query), workHandoverUsersDTO); + return R.data(pages); + } + + /** + * 详情 + */ + @GetMapping("/{id}") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入id") + public R detail(@PathVariable String id) { + WorkHandoverUsers workHandoverUsers = workHandoverUsersService.getById(id); + return R.data(Func.copy(workHandoverUsers,WorkHandoverUsersVO.class)); + } + /** + * 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(workHandoverUsersService.removeByIds(Func.toLongList(ids))); + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/HandoverHistoryMapper.java b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/HandoverHistoryMapper.java new file mode 100644 index 0000000..b869082 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/HandoverHistoryMapper.java @@ -0,0 +1,10 @@ +package org.security.trans.workHandOverUsers.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.security.ht.workHandOverUsers.entity.HandoverHistory; + +/** + * @author zj 2022/9/7 + */ +public interface HandoverHistoryMapper extends BaseMapper { +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/HandoverHistoryMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/HandoverHistoryMapper.xml new file mode 100644 index 0000000..8f8bcdd --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/HandoverHistoryMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/WorkHandoverUsersMapper.java b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/WorkHandoverUsersMapper.java new file mode 100644 index 0000000..799ed38 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/WorkHandoverUsersMapper.java @@ -0,0 +1,17 @@ +package org.security.trans.workHandOverUsers.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.security.ht.workHandOverUsers.entity.WorkHandoverUsers; +import org.security.ht.workHandOverUsers.vo.deptDataVO; + +/** + * @author :wzf + * @since :Created in 2022/9/2 16:42 + */ +public interface WorkHandoverUsersMapper extends BaseMapper { + + deptDataVO getDeptData(@Param("idCard") String idCard); + + deptDataVO getDeptByCode(@Param("deptCode") String deptCode); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/WorkHandoverUsersMapper.xml b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/WorkHandoverUsersMapper.xml new file mode 100644 index 0000000..d5c6c86 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/mapper/WorkHandoverUsersMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/HandoverHistoryService.java b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/HandoverHistoryService.java new file mode 100644 index 0000000..c4d5ee9 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/HandoverHistoryService.java @@ -0,0 +1,22 @@ +package org.security.trans.workHandOverUsers.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.ht.workHandOverUsers.entity.HandoverHistory; +import org.security.ht.workHandOverUsers.vo.HandoverHistoryVO; +import org.security.ht.workHandOverUsers.dto.HandoverHistoryDTO; +import org.springblade.core.tool.api.R; + +import java.math.BigDecimal; + +/** + * @author zj 2022/9/7 + */ +public interface HandoverHistoryService extends IService { + + IPage selectProjectPage(IPage page, HandoverHistoryDTO handoverHistoryDTO); + + R saveForm(HandoverHistoryVO handoverHistoryVO); + + HandoverHistoryDTO getDetail(String id); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/IWorkHandoverUsers.java b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/IWorkHandoverUsers.java new file mode 100644 index 0000000..22eba32 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/IWorkHandoverUsers.java @@ -0,0 +1,28 @@ +package org.security.trans.workHandOverUsers.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.security.desk.vo.FaceVO; +import org.security.ht.workHandOverUsers.entity.WorkHandoverUsers; +import org.security.ht.workHandOverUsers.vo.WorkHandoverCheckVO; +import org.security.ht.workHandOverUsers.vo.WorkHandoverUsersVO; +import org.security.ht.workHandOverUsers.dto.WorkHandoverUsersDTO; +import org.springblade.core.tool.api.R; +import org.springframework.web.multipart.MultipartFile; + +/** + * @author :wzf + * @since :Created in 2022/9/2 16:38 + */ +public interface IWorkHandoverUsers extends IService { + + R workHandoverCheck(WorkHandoverCheckVO workHandoverCheckVO); + + WorkHandoverUsersVO getByIdCard(String idCard); + + boolean saveData(WorkHandoverUsersDTO workHandoverUsersDTO); + + IPage selectProjectPage(IPage page, WorkHandoverUsersDTO workHandoverUsersDTO); + + R saveWithFace(FaceVO faceVO, MultipartFile file); +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/impl/HandoverHistoryServiceImpl.java b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/impl/HandoverHistoryServiceImpl.java new file mode 100644 index 0000000..a3ae82c --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/impl/HandoverHistoryServiceImpl.java @@ -0,0 +1,70 @@ +package org.security.trans.workHandOverUsers.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import org.apache.commons.lang.StringUtils; +import org.security.common.Constant; +import org.security.ht.vo.common.UploadVO; +import org.security.ht.workHandOverUsers.entity.HandoverHistory; +import org.security.ht.workHandOverUsers.entity.WorkHandoverUsers; +import org.security.ht.workHandOverUsers.vo.HandoverHistoryVO; +import org.security.ht.workHandOverUsers.dto.HandoverHistoryDTO; +import org.security.trans.common.service.IFileService; +import org.security.trans.workHandOverUsers.mapper.HandoverHistoryMapper; +import org.security.trans.workHandOverUsers.service.HandoverHistoryService; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +/** + * @author zj 2022/9/7 + */ +@Service +@AllArgsConstructor +public class HandoverHistoryServiceImpl extends ServiceImpl implements HandoverHistoryService { + private final IFileService fileService; + + @Override + public IPage selectProjectPage(IPage page, HandoverHistoryDTO handoverHistoryDTO) { + List list = this.list(new QueryWrapper().lambda() + .like(StringUtils.isNotBlank(handoverHistoryDTO.getHandoverFrom()),HandoverHistory::getHandoverFrom,handoverHistoryDTO.getHandoverFrom()) + .like(StringUtils.isNotBlank(handoverHistoryDTO.getHandoverTo()),HandoverHistory::getHandoverTo,handoverHistoryDTO.getHandoverTo() ) + .like(StringUtils.isNotBlank(handoverHistoryDTO.getContent()),HandoverHistory::getContent,handoverHistoryDTO.getContent()) + .orderByDesc(HandoverHistory::getHandoverTime)); + List vos = Func.copy(list,HandoverHistoryVO.class); + if(Func.isNotEmpty(vos)){ + vos.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + return page.setRecords(vos); + } + + @Override + public R saveForm(HandoverHistoryVO handoverHistoryVO){ + super.saveOrUpdate(handoverHistoryVO); + List fileList = handoverHistoryVO.getImgUrl(); + if (Objects.nonNull(fileList) && !fileList.isEmpty()) { + fileService.saveAttachments(fileList, handoverHistoryVO.getId()); + } + return R.data(handoverHistoryVO); + } + + @Override + public HandoverHistoryDTO getDetail(String id) { + HandoverHistory detail = super.getById(id); + HandoverHistoryDTO handoverHistoryDTO = new HandoverHistoryDTO(); + BeanUtils.copyProperties(detail, handoverHistoryDTO); + handoverHistoryDTO.setImgUrl(fileService.getAttachments(detail.getId(), detail.getGroupName())); + return handoverHistoryDTO; + } +} diff --git a/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/impl/WorkHandoverUsersService.java b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/impl/WorkHandoverUsersService.java new file mode 100644 index 0000000..9ad5215 --- /dev/null +++ b/security-service/ht-security/src/main/java/org/security/trans/workHandOverUsers/service/impl/WorkHandoverUsersService.java @@ -0,0 +1,173 @@ +package org.security.trans.workHandOverUsers.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import org.apache.commons.lang.StringUtils; +import org.security.common.Constant; +import org.security.desk.feign.IFaceClient; +import org.security.desk.vo.FaceVO; +import org.security.ht.workHandOverUsers.entity.WorkHandoverUsers; +import org.security.ht.workHandOverUsers.vo.WorkHandoverCheckVO; +import org.security.ht.workHandOverUsers.vo.WorkHandoverUsersVO; +import org.security.ht.workHandOverUsers.vo.deptDataVO; +import org.security.ht.workHandOverUsers.dto.WorkHandoverUsersDTO; +import org.security.trans.common.service.IFileService; +import org.security.trans.workHandOverUsers.mapper.WorkHandoverUsersMapper; +import org.security.trans.workHandOverUsers.service.IWorkHandoverUsers; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +/** + * @author :wzf + * @since :Created in 2022/9/2 16:39 + */ +@Service +@AllArgsConstructor +public class WorkHandoverUsersService extends ServiceImpl implements IWorkHandoverUsers { + private final IFaceClient faceClient; + private final IFileService fileService; + + @Override + public R workHandoverCheck(WorkHandoverCheckVO workHandoverCheckVO) { + boolean sameUser = false; + if (workHandoverCheckVO.getHandoverFromIdCard().equals(workHandoverCheckVO.getHandoverToIdCard())) { + if (Constant.WORK_HANDOVER_USER_TYPE_OUT == workHandoverCheckVO.getHandoverFromType()) { + if (workHandoverCheckVO.getHandoverFromType() == workHandoverCheckVO.getHandoverFromType()) { + sameUser = true; + } + } + } + if (workHandoverCheckVO.getHandoverFromAcc().equals(workHandoverCheckVO.getHandoverToAcc())) { + if (Constant.WORK_HANDOVER_USER_TYPE_BANK == workHandoverCheckVO.getHandoverFromType()) { + if (workHandoverCheckVO.getHandoverFromType() == workHandoverCheckVO.getHandoverFromType()) { + sameUser = true; + } + } + } + if (sameUser) { + return R.fail("同一用户无法完成交接"); + } + QueryWrapper fromQuery = generateCheckWrapper(Constant.WORK_HANDOVER_USER_TYPE_OUT == workHandoverCheckVO.getHandoverFromType(), + workHandoverCheckVO.getHandoverFrom(), workHandoverCheckVO.getHandoverFromIdCard(), workHandoverCheckVO.getHandoverFromAcc()); + WorkHandoverUsers fromUser = baseMapper.selectOne(fromQuery); + if (Func.isEmpty(fromUser)) { + return R.fail("交接人不在交接工作组内!"); + } + if (0 == fromUser.getFaceState()) { + return R.fail("交接人尚未完成人脸注册!"); + } + + QueryWrapper toQuery = generateCheckWrapper(Constant.WORK_HANDOVER_USER_TYPE_OUT == workHandoverCheckVO.getHandoverToType(), + workHandoverCheckVO.getHandoverTo(), workHandoverCheckVO.getHandoverToIdCard(), workHandoverCheckVO.getHandoverToAcc()); + WorkHandoverUsers toUser = baseMapper.selectOne(toQuery); + if (Func.isEmpty(toUser)) { + return R.fail("被交接人不在交接工作组内!"); + } + if (0 == toUser.getFaceState()) { + return R.fail("被交接人尚未完成人脸注册!"); + } + return R.status(Boolean.TRUE); + } + + private QueryWrapper generateCheckWrapper(boolean outsiders, String name, String idCard, String account) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_name", name); + if (outsiders) { + queryWrapper.eq("ID_card", idCard); + } else { + queryWrapper.eq("account", account); + } + return queryWrapper; + } + + private int countByNameAndIdCard(String name, String idCard) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_name", name); + queryWrapper.eq("ID_card", idCard); + return baseMapper.selectCount(queryWrapper); + } + + private int countByNameAndAccount(String name, String account) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_name", name); + queryWrapper.eq("account", account); + return baseMapper.selectCount(queryWrapper); + } + + @Override + public WorkHandoverUsersVO getByIdCard(String idCard) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("ID_card", idCard); + WorkHandoverUsers workHandoverUsers = baseMapper.selectOne(queryWrapper); + return BeanUtil.copy(workHandoverUsers, WorkHandoverUsersVO.class); + } + + @Override + public boolean saveData(WorkHandoverUsersDTO workHandoverUsersDTO) { + WorkHandoverUsers workHandoverUsers = Func.copy(workHandoverUsersDTO, WorkHandoverUsers.class); + //获取工作交接用户的机构信息 + if (Func.isNotEmpty(workHandoverUsersDTO.getUserType()) && Constant.WORK_HANDOVER_USER_TYPE_BANK == workHandoverUsersDTO.getUserType() + && Func.isNotEmpty(workHandoverUsersDTO.getIDCard())) { + deptDataVO dataVO = baseMapper.getDeptData(workHandoverUsersDTO.getIDCard()); + if (Func.isNotEmpty(dataVO)) { + workHandoverUsers.setDeptId(dataVO.getDeptId()); + workHandoverUsers.setDeptName(dataVO.getDeptName()); + } + } + return this.saveOrUpdate(workHandoverUsers); + } + + @Override + public IPage selectProjectPage(IPage page, WorkHandoverUsersDTO workHandoverUsersDTO) { + List list = this.list(new QueryWrapper().lambda().eq(WorkHandoverUsers::getDelFlag, Constant.DELETE_FLAG_0) + .eq(0 != workHandoverUsersDTO.getUserType(), WorkHandoverUsers::getUserType, workHandoverUsersDTO.getUserType()) + .eq(9 != workHandoverUsersDTO.getFaceState(), WorkHandoverUsers::getFaceState, workHandoverUsersDTO.getFaceState()) + .like(StringUtils.isNotBlank(workHandoverUsersDTO.getUserName()), WorkHandoverUsers::getUserName, workHandoverUsersDTO.getUserName())); + List vos = Func.copy(list, WorkHandoverUsersVO.class); + if(Func.isNotEmpty(vos)){ + vos.forEach(item->{ + // 创建人名称 + item.setCreatedByName(fileService.getUserNameById(item.getCreatedBy())); + // 更新人名称 + item.setUpdatedByName(fileService.getUserNameById(item.getUpdatedBy())); + }); + } + return page.setRecords(vos); + } + + @Override + public R saveWithFace(FaceVO faceVO, MultipartFile file) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("user_name", faceVO.getFullName()); + queryWrapper.eq("ID_card", faceVO.getIdCardNo()); + WorkHandoverUsers users = baseMapper.selectOne(queryWrapper); + if (!Func.isEmpty(users)) { + if (1 == users.getFaceState()) { + return R.fail("该交接人信息已存在且通过了人脸认证,请勿重复提交!"); + } + } else { + users = new WorkHandoverUsers(); + } + R r = faceClient.faceRegister(faceVO, file); + if (!r.isSuccess()) { + return r; + } + FaceVO faceResult = r.getData(); + users.setUserType(faceResult.isOutsiders() ? Constant.WORK_HANDOVER_USER_TYPE_OUT : Constant.WORK_HANDOVER_USER_TYPE_BANK); + users.setUserName(faceResult.getFullName()); + users.setIDCard(faceResult.getIdCardNo()); + users.setAccount(faceResult.getEmployeeNo()); + users.setFaceState(1); + deptDataVO dept = baseMapper.getDeptByCode(faceResult.getDeptNo()); + users.setDeptId(dept.getDeptId()); + users.setDeptName(dept.getDeptName()); + return R.status(this.saveOrUpdate(users)); + } +} diff --git a/security-service/ht-security/src/main/resources/ESAPI.properties b/security-service/ht-security/src/main/resources/ESAPI.properties new file mode 100644 index 0000000..a8c3453 --- /dev/null +++ b/security-service/ht-security/src/main/resources/ESAPI.properties @@ -0,0 +1,438 @@ +## +## OWASP Enterprise Security API (ESAPI) Properties file -- PRODUCTION Version +## +## This file is part of the Open Web Application Security Project (OWASP) +## Enterprise Security API (ESAPI) project. For details, please see +## http://www.owasp.org/index.php/ESAPI. +## +## Copyright (c) 2008,2009 - The OWASP Foundation +## +## DISCUSS: This may cause a major backwards compatibility issue, etc. but +## from a name space perspective, we probably should have prefaced +## all the property names with ESAPI or at least OWASP. Otherwise +## there could be problems is someone loads this properties file into +## the System properties. We could also put this file into the +## esapi.jar file (perhaps as a ResourceBundle) and then allow an external +## ESAPI properties be defined that would overwrite these defaults. +## That keeps the application's properties relatively simple as usually +## they will only want to override a few properties. If looks like we +## already support multiple override levels of this in the +## DefaultSecurityConfiguration class, but I'm suggesting placing the +## defaults in the esapi.jar itself. That way, if the jar is signed, +## we could detect if those properties had been tampered with. (The +## code to check the jar signatures is pretty simple... maybe 70-90 LOC, +## but off course there is an execution penalty (similar to the way +## that the separate sunjce.jar used to be when a class from it was +## first loaded). Thoughts? +################################################################################ +## +## WARNING: Operating system protection should be used to lock down the .esapi +## resources directory and all the files inside and all the directories all the +## way up to the root directory of the file system. Note that if you are using +## file-based implementations, that some files may need to be read-write as they +## get updated dynamically. +## +## Before using, be sure to update the MasterKey and MasterSalt as described below. +## N.B.: If you had stored data that you have previously encrypted with ESAPI 1.4, +## you *must* FIRST decrypt it using ESAPI 1.4 and then (if so desired) +## re-encrypt it with ESAPI 2.0. If you fail to do this, you will NOT be +## able to decrypt your data with ESAPI 2.0. +## +## YOU HAVE BEEN WARNED!!! More details are in the ESAPI 2.0 Release Notes. +## +##=========================================================================== +## ESAPI Configuration +## +## If true, then print all the ESAPI properties set here when they are loaded. +## If false, they are not printed. Useful to reduce output when running JUnit tests. +## If you need to troubleshoot a properties related problem, turning this on may help. +## This is 'false' in the src/test/resources/.esapi version. It is 'true' by +## default for reasons of backward compatibility with earlier ESAPI versions. +#ESAPI.printProperties=true +# +## ESAPI is designed to be easily extensible. You can use the reference implementation +## or implement your own providers to take advantage of your enterprise's security +## infrastructure. The functions in ESAPI are referenced using the ESAPI locator, like: +## +## String ciphertext = +## ESAPI.encryptor().encrypt("Secret message"); // Deprecated in 2.0 +## CipherText cipherText = +## ESAPI.encryptor().encrypt(new PlainText("Secret message")); // Preferred +## +## Below you can specify the classname for the provider that you wish to use in your +## application. The only requirement is that it implement the appropriate ESAPI interface. +## This allows you to switch security implementations in the future without rewriting the +## entire application. +## +## ExperimentalAccessController requires ESAPI-AccessControlPolicy.xml in .esapi directory +#ESAPI.AccessControl=org.owasp.esapi.reference.DefaultAccessController +## FileBasedAuthenticator requires users.txt file in .esapi directory +#ESAPI.Authenticator=org.owasp.esapi.reference.FileBasedAuthenticator +#ESAPI.Encoder=org.owasp.esapi.reference.DefaultEncoder +#ESAPI.Encryptor=org.owasp.esapi.reference.crypto.JavaEncryptor +# +#ESAPI.Executor=org.owasp.esapi.reference.DefaultExecutor +#ESAPI.HTTPUtilities=org.owasp.esapi.reference.DefaultHTTPUtilities +#ESAPI.IntrusionDetector=org.owasp.esapi.reference.DefaultIntrusionDetector +## Log4JFactory Requires log4j.xml or log4j.properties in classpath - http://www.laliluna.de/log4j-tutorial.html +#ESAPI.Logger=org.owasp.esapi.reference.Log4JLogFactory +##ESAPI.Logger=org.owasp.esapi.reference.JavaLogFactory +#ESAPI.Randomizer=org.owasp.esapi.reference.DefaultRandomizer +#ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator +# +##=========================================================================== +## ESAPI Authenticator +## +#Authenticator.AllowedLoginAttempts=3 +#Authenticator.MaxOldPasswordHashes=13 +#Authenticator.UsernameParameterName=username +#Authenticator.PasswordParameterName=password +## RememberTokenDuration (in days) +#Authenticator.RememberTokenDuration=14 +## Session Timeouts (in minutes) +#Authenticator.IdleTimeoutDuration=20 +#Authenticator.AbsoluteTimeoutDuration=120 +# +##=========================================================================== +## ESAPI Encoder +## +## ESAPI canonicalizes input before validation to prevent bypassing filters with encoded attacks. +## Failure to canonicalize input is a very common mistake when implementing validation schemes. +## Canonicalization is automatic when using the ESAPI Validator, but you can also use the +## following code to canonicalize data. +## +## ESAPI.Encoder().canonicalize( "%22hello world"" ); +## +## Multiple encoding is when a single encoding format is applied multiple times. Allowing +## multiple encoding is strongly discouraged. +#Encoder.AllowMultipleEncoding=false +# +## Mixed encoding is when multiple different encoding formats are applied, or when +## multiple formats are nested. Allowing multiple encoding is strongly discouraged. +#Encoder.AllowMixedEncoding=false +# +## The default list of codecs to apply when canonicalizing untrusted data. The list should include the codecs +## for all downstream interpreters or decoders. For example, if the data is likely to end up in a URL, HTML, or +## inside JavaScript, then the list of codecs below is appropriate. The order of the list is not terribly important. +#Encoder.DefaultCodecList=HTMLEntityCodec,PercentCodec,JavaScriptCodec +# +# +##=========================================================================== +## ESAPI Encryption +## +## The ESAPI Encryptor provides basic cryptographic functions with a simplified API. +## To get started, generate a new key using java -classpath esapi.jar org.owasp.esapi.reference.crypto.JavaEncryptor +## There is not currently any support for key rotation, so be careful when changing your key and salt as it +## will invalidate all signed, encrypted, and hashed data. +## +## WARNING: Not all combinations of algorithms and key lengths are supported. +## If you choose to use a key length greater than 128, you MUST download the +## unlimited strength policy files and install in the lib directory of your JRE/JDK. +## See http://java.sun.com/javase/downloads/index.jsp for more information. +## +## Backward compatibility with ESAPI Java 1.4 is supported by the two deprecated API +## methods, Encryptor.encrypt(String) and Encryptor.decrypt(String). However, whenever +## possible, these methods should be avoided as they use ECB cipher mode, which in almost +## all circumstances a poor choice because of it's weakness. CBC cipher mode is the default +## for the new Encryptor encrypt / decrypt methods for ESAPI Java 2.0. In general, you +## should only use this compatibility setting if you have persistent data encrypted with +## version 1.4 and even then, you should ONLY set this compatibility mode UNTIL +## you have decrypted all of your old encrypted data and then re-encrypted it with +## ESAPI 2.0 using CBC mode. If you have some reason to mix the deprecated 1.4 mode +## with the new 2.0 methods, make sure that you use the same cipher algorithm for both +## (256-bit AES was the default for 1.4; 128-bit is the default for 2.0; see below for +## more details.) Otherwise, you will have to use the new 2.0 encrypt / decrypt methods +## where you can specify a SecretKey. (Note that if you are using the 256-bit AES, +## that requires downloading the special jurisdiction policy files mentioned above.) +## +## ***** IMPORTANT: Do NOT forget to replace these with your own values! ***** +## To calculate these values, you can run: +## java -classpath esapi.jar org.owasp.esapi.reference.crypto.JavaEncryptor +## +##Encryptor.MasterKey= +##Encryptor.MasterSalt= +# +## Provides the default JCE provider that ESAPI will "prefer" for its symmetric +## encryption and hashing. (That is it will look to this provider first, but it +## will defer to other providers if the requested algorithm is not implemented +## by this provider.) If left unset, ESAPI will just use your Java VM's current +## preferred JCE provider, which is generally set in the file +## "$JAVA_HOME/jre/lib/security/java.security". +## +## The main intent of this is to allow ESAPI symmetric encryption to be +## used with a FIPS 140-2 compliant crypto-module. For details, see the section +## "Using ESAPI Symmetric Encryption with FIPS 140-2 Cryptographic Modules" in +## the ESAPI 2.0 Symmetric Encryption User Guide, at: +## http://owasp-esapi-java.googlecode.com/svn/trunk/documentation/esapi4java-core-2.0-symmetric-crypto-user-guide.html +## However, this property also allows you to easily use an alternate JCE provider +## such as "Bouncy Castle" without having to make changes to "java.security". +## See Javadoc for SecurityProviderLoader for further details. If you wish to use +## a provider that is not known to SecurityProviderLoader, you may specify the +## fully-qualified class name of the JCE provider class that implements +## java.security.Provider. If the name contains a '.', this is interpreted as +## a fully-qualified class name that implements java.security.Provider. +## +## NOTE: Setting this property has the side-effect of changing it in your application +## as well, so if you are using JCE in your application directly rather than +## through ESAPI (you wouldn't do that, would you? ;-), it will change the +## preferred JCE provider there as well. +## +## Default: Keeps the JCE provider set to whatever JVM sets it to. +#Encryptor.PreferredJCEProvider= +# +## AES is the most widely used and strongest encryption algorithm. This +## should agree with your Encryptor.CipherTransformation property. +## By default, ESAPI Java 1.4 uses "PBEWithMD5AndDES" and which is +## very weak. It is essentially a password-based encryption key, hashed +## with MD5 around 1K times and then encrypted with the weak DES algorithm +## (56-bits) using ECB mode and an unspecified padding (it is +## JCE provider specific, but most likely "NoPadding"). However, 2.0 uses +## "AES/CBC/PKCSPadding". If you want to change these, change them here. +## Warning: This property does not control the default reference implementation for +## ESAPI 2.0 using JavaEncryptor. Also, this property will be dropped +## in the future. +## @deprecated +#Encryptor.EncryptionAlgorithm=AES +## For ESAPI Java 2.0 - New encrypt / decrypt methods use this. +#Encryptor.CipherTransformation=AES/CBC/PKCS5Padding +# +## Applies to ESAPI 2.0 and later only! +## Comma-separated list of cipher modes that provide *BOTH* +## confidentiality *AND* message authenticity. (NIST refers to such cipher +## modes as "combined modes" so that's what we shall call them.) If any of these +## cipher modes are used then no MAC is calculated and stored +## in the CipherText upon encryption. Likewise, if one of these +## cipher modes is used with decryption, no attempt will be made +## to validate the MAC contained in the CipherText object regardless +## of whether it contains one or not. Since the expectation is that +## these cipher modes support support message authenticity already, +## injecting a MAC in the CipherText object would be at best redundant. +## +## Note that as of JDK 1.5, the SunJCE provider does not support *any* +## of these cipher modes. Of these listed, only GCM and CCM are currently +## NIST approved. YMMV for other JCE providers. E.g., Bouncy Castle supports +## GCM and CCM with "NoPadding" mode, but not with "PKCS5Padding" or other +## padding modes. +#Encryptor.cipher_modes.combined_modes=GCM,CCM,IAPM,EAX,OCB,CWC +# +## Applies to ESAPI 2.0 and later only! +## Additional cipher modes allowed for ESAPI 2.0 encryption. These +## cipher modes are in _addition_ to those specified by the property +## 'Encryptor.cipher_modes.combined_modes'. +## Note: We will add support for streaming modes like CFB & OFB once +## we add support for 'specified' to the property 'Encryptor.ChooseIVMethod' +## (probably in ESAPI 2.1). +## DISCUSS: Better name? +#Encryptor.cipher_modes.additional_allowed=CBC +# +## 128-bit is almost always sufficient and appears to be more resistant to +## related key attacks than is 256-bit AES. Use '_' to use default key size +## for cipher algorithms (where it makes sense because the algorithm supports +## a variable key size). Key length must agree to what's provided as the +## cipher transformation, otherwise this will be ignored after logging a +## warning. +## +## NOTE: This is what applies BOTH ESAPI 1.4 and 2.0. See warning above about mixing! +#Encryptor.EncryptionKeyLength=128 +# +## Because 2.0 uses CBC mode by default, it requires an initialization vector (IV). +## (All cipher modes except ECB require an IV.) There are two choices: we can either +## use a fixed IV known to both parties or allow ESAPI to choose a random IV. While +## the IV does not need to be hidden from adversaries, it is important that the +## adversary not be allowed to choose it. Also, random IVs are generally much more +## secure than fixed IVs. (In fact, it is essential that feed-back cipher modes +## such as CFB and OFB use a different IV for each encryption with a given key so +## in such cases, random IVs are much preferred. By default, ESAPI 2.0 uses random +## IVs. If you wish to use 'fixed' IVs, set 'Encryptor.ChooseIVMethod=fixed' and +## uncomment the Encryptor.fixedIV. +## +## Valid values: random|fixed|specified 'specified' not yet implemented; planned for 2.1 +#Encryptor.ChooseIVMethod=random +## If you choose to use a fixed IV, then you must place a fixed IV here that +## is known to all others who are sharing your secret key. The format should +## be a hex string that is the same length as the cipher block size for the +## cipher algorithm that you are using. The following is an example for AES +## from an AES test vector for AES-128/CBC as described in: +## NIST Special Publication 800-38A (2001 Edition) +## "Recommendation for Block Cipher Modes of Operation". +## (Note that the block size for AES is 16 bytes == 128 bits.) +## +#Encryptor.fixedIV=0x000102030405060708090a0b0c0d0e0f +# +## Whether or not CipherText should use a message authentication code (MAC) with it. +## This prevents an adversary from altering the IV as well as allowing a more +## fool-proof way of determining the decryption failed because of an incorrect +## key being supplied. This refers to the "separate" MAC calculated and stored +## in CipherText, not part of any MAC that is calculated as a result of a +## "combined mode" cipher mode. +## +## If you are using ESAPI with a FIPS 140-2 cryptographic module, you *must* also +## set this property to false. +#Encryptor.CipherText.useMAC=true +# +## Whether or not the PlainText object may be overwritten and then marked +## eligible for garbage collection. If not set, this is still treated as 'true'. +#Encryptor.PlainText.overwrite=true +# +## Do not use DES except in a legacy situations. 56-bit is way too small key size. +##Encryptor.EncryptionKeyLength=56 +##Encryptor.EncryptionAlgorithm=DES +# +## TripleDES is considered strong enough for most purposes. +## Note: There is also a 112-bit version of DESede. Using the 168-bit version +## requires downloading the special jurisdiction policy from Sun. +##Encryptor.EncryptionKeyLength=168 +##Encryptor.EncryptionAlgorithm=DESede +# +#Encryptor.HashAlgorithm=SHA-512 +#Encryptor.HashIterations=1024 +#Encryptor.DigitalSignatureAlgorithm=SHA1withDSA +#Encryptor.DigitalSignatureKeyLength=1024 +#Encryptor.RandomAlgorithm=SHA1PRNG +#Encryptor.CharacterEncoding=UTF-8 +# +# +##=========================================================================== +## ESAPI HttpUtilties +## +## The HttpUtilities provide basic protections to HTTP requests and responses. Primarily these methods +## protect against malicious data from attackers, such as unprintable characters, escaped characters, +## and other simple attacks. The HttpUtilities also provides utility methods for dealing with cookies, +## headers, and CSRF tokens. +## +## Default file upload location (remember to escape backslashes with \\) +#HttpUtilities.UploadDir=C:\\ESAPI\\testUpload +#HttpUtilities.UploadTempDir=C:\\temp +## Force flags on cookies, if you use HttpUtilities to set cookies +#HttpUtilities.ForceHttpOnlySession=false +#HttpUtilities.ForceSecureSession=false +#HttpUtilities.ForceHttpOnlyCookies=true +#HttpUtilities.ForceSecureCookies=true +## Maximum size of HTTP headers +#HttpUtilities.MaxHeaderSize=4096 +## File upload configuration +HttpUtilities.ApprovedUploadExtensions=.zip,.pdf,.doc,.docx,.ppt,.pptx,.tar,.gz,.tgz,.rar,.war,.jar,.ear,.xls,.rtf,.properties,.java,.class,.txt,.xml,.jsp,.jsf,.exe,.dll +#HttpUtilities.MaxUploadFileBytes=500000000 +## Using UTF-8 throughout your stack is highly recommended. That includes your database driver, +## container, and any other technologies you may be using. Failure to do this may expose you +## to Unicode transcoding injection attacks. Use of UTF-8 does not hinder internationalization. +#HttpUtilities.ResponseContentType=text/html; charset=UTF-8 +## This is the name of the cookie used to represent the HTTP session +## Typically this will be the default "JSESSIONID" +#HttpUtilities.HttpSessionIdName=JSESSIONID +# +# +# +##=========================================================================== +## ESAPI Executor +## CHECKME - Not sure what this is used for, but surely it should be made OS independent. +#Executor.WorkingDirectory=C:\\Windows\\Temp +#Executor.ApprovedExecutables=C:\\Windows\\System32\\cmd.exe,C:\\Windows\\System32\\runas.exe +# +# +##=========================================================================== +## ESAPI Logging +## Set the application name if these logs are combined with other applications +#Logger.ApplicationName=ExampleApplication +## If you use an HTML log viewer that does not properly HTML escape log data, you can set LogEncodingRequired to true +#Logger.LogEncodingRequired=false +## Determines whether ESAPI should log the application name. This might be clutter in some single-server/single-app environments. +#Logger.LogApplicationName=true +## Determines whether ESAPI should log the server IP and port. This might be clutter in some single-server environments. +#Logger.LogServerIP=true +## LogFileName, the name of the logging file. Provide a full directory path (e.g., C:\\ESAPI\\ESAPI_logging_file) if you +## want to place it in a specific directory. +#Logger.LogFileName=ESAPI_logging_file +## MaxLogFileSize, the max size (in bytes) of a single log file before it cuts over to a new one (default is 10,000,000) +#Logger.MaxLogFileSize=10000000 +# +# +##=========================================================================== +## ESAPI Intrusion Detection +## +## Each event has a base to which .count, .interval, and .action are added +## The IntrusionException will fire if we receive "count" events within "interval" seconds +## The IntrusionDetector is configurable to take the following actions: log, logout, and disable +## (multiple actions separated by commas are allowed e.g. event.test.actions=log,disable +## +## Custom Events +## Names must start with "event." as the base +## Use IntrusionDetector.addEvent( "test" ) in your code to trigger "event.test" here +## You can also disable intrusion detection completely by changing +## the following parameter to true +## +#IntrusionDetector.Disable=false +## +#IntrusionDetector.event.test.count=2 +#IntrusionDetector.event.test.interval=10 +#IntrusionDetector.event.test.actions=disable,log +# +## Exception Events +## All EnterpriseSecurityExceptions are registered automatically +## Call IntrusionDetector.getInstance().addException(e) for Exceptions that do not extend EnterpriseSecurityException +## Use the fully qualified classname of the exception as the base +# +## any intrusion is an attack +#IntrusionDetector.org.owasp.esapi.errors.IntrusionException.count=1 +#IntrusionDetector.org.owasp.esapi.errors.IntrusionException.interval=1 +#IntrusionDetector.org.owasp.esapi.errors.IntrusionException.actions=log,disable,logout +# +## for test purposes +## CHECKME: Shouldn't there be something in the property name itself that designates +## that these are for testing??? +#IntrusionDetector.org.owasp.esapi.errors.IntegrityException.count=10 +#IntrusionDetector.org.owasp.esapi.errors.IntegrityException.interval=5 +#IntrusionDetector.org.owasp.esapi.errors.IntegrityException.actions=log,disable,logout +# +## rapid validation errors indicate scans or attacks in progress +## org.owasp.esapi.errors.ValidationException.count=10 +## org.owasp.esapi.errors.ValidationException.interval=10 +## org.owasp.esapi.errors.ValidationException.actions=log,logout +# +## sessions jumping between hosts indicates session hijacking +#IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.count=2 +#IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.interval=10 +#IntrusionDetector.org.owasp.esapi.errors.AuthenticationHostException.actions=log,logout +# +# +##=========================================================================== +## ESAPI Validation +## +## The ESAPI Validator works on regular expressions with defined names. You can define names +## either here, or you may define application specific patterns in a separate file defined below. +## This allows enterprises to specify both organizational standards as well as application specific +## validation rules. +## +#Validator.ConfigurationFile=validation.properties +# +## Validators used by ESAPI +#Validator.AccountName=^[a-zA-Z0-9]{3,20}$ +#Validator.SystemCommand=^[a-zA-Z\\-\\/]{1,64}$ +#Validator.RoleName=^[a-z]{1,20}$ +# +##the word TEST below should be changed to your application +##name - only relative URL's are supported +#Validator.Redirect=^\\/test.*$ +# +## Global HTTP Validation Rules +## Values with Base64 encoded data (e.g. encrypted state) will need at least [a-zA-Z0-9\/+=] +#Validator.HTTPScheme=^(http|https)$ +#Validator.HTTPServerName=^[a-zA-Z0-9_.\\-]*$ +#Validator.HTTPParameterName=^[a-zA-Z0-9_]{1,32}$ +#Validator.HTTPParameterValue=^[a-zA-Z0-9.\\-\\/+=@_ ]*$ +#Validator.HTTPCookieName=^[a-zA-Z0-9\\-_]{1,32}$ +#Validator.HTTPCookieValue=^[a-zA-Z0-9\\-\\/+=_ ]*$ +#Validator.HTTPHeaderName=^[a-zA-Z0-9\\-_]{1,32}$ +#Validator.HTTPHeaderValue=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$ +#Validator.HTTPContextPath=^[a-zA-Z0-9.\\-\\/_]*$ +#Validator.HTTPServletPath=^[a-zA-Z0-9.\\-\\/_]*$ +#Validator.HTTPPath=^[a-zA-Z0-9.\\-_]*$ +#Validator.HTTPQueryString=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ %]*$ +#Validator.HTTPURI=^[a-zA-Z0-9()\\-=\\*\\.\\?;,+\\/:&_ ]*$ +#Validator.HTTPURL=^.*$ +#Validator.HTTPJSESSIONID=^[A-Z0-9]{10,30}$ +# +## Validation of file related input +Validator.FileName=^[a-zA-Z0-9!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$ +Validator.DirectoryName=^[a-zA-Z0-9:/\\\\!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$ +# diff --git a/security-service/ht-security/src/main/resources/application-dev.yml b/security-service/ht-security/src/main/resources/application-dev.yml new file mode 100644 index 0000000..ca05c53 --- /dev/null +++ b/security-service/ht-security/src/main/resources/application-dev.yml @@ -0,0 +1,16 @@ +#数据源配置 +spring: + datasource: + url: ${blade.datasource.dev.url} + username: ${blade.datasource.dev.username} + password: ${blade.datasource.dev.password} + +blade: + xss: + enabled: true + skip-url: + - /publicity/save + - /publicity/update + - /publicity/submit + + diff --git a/security-service/ht-security/src/main/resources/application-prod.yml b/security-service/ht-security/src/main/resources/application-prod.yml new file mode 100644 index 0000000..818e2a1 --- /dev/null +++ b/security-service/ht-security/src/main/resources/application-prod.yml @@ -0,0 +1,15 @@ +#数据源配置 +spring: + datasource: + url: ${blade.datasource.prod.url} + username: ${blade.datasource.prod.username} + password: ${blade.datasource.prod.password} + + +blade: + xss: + enabled: true + skip-url: + - /publicity/save + - /publicity/update + - /publicity/submit diff --git a/security-service/ht-security/src/main/resources/application-test.yml b/security-service/ht-security/src/main/resources/application-test.yml new file mode 100644 index 0000000..4b924d2 --- /dev/null +++ b/security-service/ht-security/src/main/resources/application-test.yml @@ -0,0 +1,16 @@ +#数据源配置 +spring: + datasource: + url: ${blade.datasource.test.url} + username: ${blade.datasource.test.username} + password: ${blade.datasource.test.password} + + + +blade: + xss: + enabled: true + skip-url: + - /publicity/save + - /publicity/update + - /publicity/submit diff --git a/security-service/ht-security/src/main/resources/application.yml b/security-service/ht-security/src/main/resources/application.yml new file mode 100644 index 0000000..6eea442 --- /dev/null +++ b/security-service/ht-security/src/main/resources/application.yml @@ -0,0 +1,3 @@ +#服务器端口 +server: + port: 9000 diff --git a/security-service/ht-security/src/main/resources/log/logback-dev.xml b/security-service/ht-security/src/main/resources/log/logback-dev.xml new file mode 100644 index 0000000..c23978f --- /dev/null +++ b/security-service/ht-security/src/main/resources/log/logback-dev.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + utf8 + + + + + + txcode + ht-security + + + + ${logdir}/${txcode}.log + false + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %msg%n + + + + ${logdir}/${txcode}.%d{yyyy-MM-dd}.%i.log + 100 + 50MB + 2048MB + + + + + + + + true + -1 + 1024 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/resources/log/logback-prod.xml b/security-service/ht-security/src/main/resources/log/logback-prod.xml new file mode 100644 index 0000000..c23978f --- /dev/null +++ b/security-service/ht-security/src/main/resources/log/logback-prod.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + utf8 + + + + + + txcode + ht-security + + + + ${logdir}/${txcode}.log + false + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %msg%n + + + + ${logdir}/${txcode}.%d{yyyy-MM-dd}.%i.log + 100 + 50MB + 2048MB + + + + + + + + true + -1 + 1024 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/resources/log/logback-test.xml b/security-service/ht-security/src/main/resources/log/logback-test.xml new file mode 100644 index 0000000..c23978f --- /dev/null +++ b/security-service/ht-security/src/main/resources/log/logback-test.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + utf8 + + + + + + txcode + ht-security + + + + ${logdir}/${txcode}.log + false + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} %msg%n + + + + ${logdir}/${txcode}.%d{yyyy-MM-dd}.%i.log + 100 + 50MB + 2048MB + + + + + + + + true + -1 + 1024 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/security-service/ht-security/src/main/resources/mybatis-config.xml b/security-service/ht-security/src/main/resources/mybatis-config.xml new file mode 100644 index 0000000..0345fc2 --- /dev/null +++ b/security-service/ht-security/src/main/resources/mybatis-config.xml @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/security-service/ht-security/src/main/resources/validation.properties b/security-service/ht-security/src/main/resources/validation.properties new file mode 100644 index 0000000..a1735ac --- /dev/null +++ b/security-service/ht-security/src/main/resources/validation.properties @@ -0,0 +1,29 @@ +# The ESAPI validator does many security checks on input, such as canonicalization +# and whitelist validation. Note that all of these validation rules are applied *after* +# canonicalization. Double-encoded characters (even with different encodings involved, +# are never allowed. +# +# To use: +# +# First set up a pattern below. You can choose any name you want, prefixed by the word +# "Validation." For example: +# Validation.Email=^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,4}$ +# +# Then you can validate in your code against the pattern like this: +# ESAPI.validator().isValidInput("User Email", input, "Email", maxLength, allowNull); +# Where maxLength and allowNull are set for you needs, respectively. +# +# But note, when you use boolean variants of validation functions, you lose critical +# canonicalization. It is preferable to use the "get" methods (which throw exceptions) and +# and use the returned user input which is in canonical form. Consider the following: +# +# try { +# someObject.setEmail(ESAPI.validator().getValidInput("User Email", input, "Email", maxLength, allowNull)); +# +#Validator.SafeString=^[.\\p{Alnum}\\p{Space}]{0,1024}$ +#Validator.Email=^[A-Za-z0-9._%'-]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,4}$ +#Validator.IPAddress=^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ +#Validator.URL=^(ht|f)tp(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\.\\?\\,\\:\\'\\/\\\\\\+=&%\\$#_]*)?$ +#Validator.CreditCard=^(\\d{4}[- ]?){3}\\d{4}$ +#Validator.SSN=^(?!000)([0-6]\\d{2}|7([0-6]\\d|7[012]))([ -]?)(?!00)\\d\\d\\3(?!0000)\\d{4}$ + diff --git a/security-service/pom.xml b/security-service/pom.xml index 87dd5f2..5dd282c 100644 --- a/security-service/pom.xml +++ b/security-service/pom.xml @@ -17,10 +17,10 @@ pom - + security-desk security-system security-user - security-busi + ht-security @@ -50,11 +50,11 @@ security-scope-api ${bladex.project.version} - - - - - + + com.alipay.oceanbase + oceanbase-client + 2.2.8.1 + com.alibaba druid-spring-boot-starter diff --git a/security-service/security-desk/pom.xml b/security-service/security-desk/pom.xml index 832ff8b..dafcf76 100644 --- a/security-service/security-desk/pom.xml +++ b/security-service/security-desk/pom.xml @@ -71,19 +71,19 @@ blade-core-tool - - - - - - - - - - + + com.ynhtbank.emb + htb-emb-base + 1.0.3 + + + com.ynhtbank.emb + htb-emb-pulsar + 1.0.6 + org.security - security-busi-api + ht-security-api ${bladex.project.version} @@ -107,16 +107,16 @@ xstream 1.4.20 - - - - - - - - - - + + com.sunyard.nicmp + sun-ws-all + 3.2.1 + + + com.sunyard.nicmp + SunECMClient + 3.2.0 + org.owasp.esapi esapi diff --git a/security-service/security-desk/src/main/java/org/security/basicDataSync/controller/HtbPulsarConsumerController.java b/security-service/security-desk/src/main/java/org/security/basicDataSync/controller/HtbPulsarConsumerController.java index ab23dfd..f80270e 100644 --- a/security-service/security-desk/src/main/java/org/security/basicDataSync/controller/HtbPulsarConsumerController.java +++ b/security-service/security-desk/src/main/java/org/security/basicDataSync/controller/HtbPulsarConsumerController.java @@ -1,8 +1,8 @@ package org.security.basicDataSync.controller; -//import com.ynhtbank.emb.base.ConsumerCallback; -//import com.ynhtbank.emb.base.message.HtbMessage; -//import com.ynhtbank.emb.pulsar.HtbPulsarConsumer; +import com.ynhtbank.emb.base.ConsumerCallback; +import com.ynhtbank.emb.base.message.HtbMessage; +import com.ynhtbank.emb.pulsar.HtbPulsarConsumer; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.security.basicDataSync.service.IDeptLevlSyncHistoryService; @@ -25,27 +25,27 @@ import java.util.List; public class HtbPulsarConsumerController { private final IDeptLevlSyncHistoryService deptLevlSyncHistoryService; private final ESMProperties esmProperties; -// @Bean -// public void syncMsgData() throws Exception{ -// HtbPulsarConsumer pulsarConsumer = new HtbPulsarConsumer(); -// pulsarConsumer.setBrokerServiceurl(esmProperties.getBrokerServiceurl()); -// pulsarConsumer.setAccessToken(esmProperties.getAccessToken()); -// pulsarConsumer.setSubscriptionName(esmProperties.getSubscriptionName()); -// pulsarConsumer.setListenerName(esmProperties.getListenerName()); -// pulsarConsumer.setEnvValue(esmProperties.getEvnValue()); -// pulsarConsumer.setTopicNames(esmProperties.getTopicNames()); -// pulsarConsumer.setCorePoolSize(esmProperties.getCorePoolSize()); -// log.info("消息总线请求url【】" + esmProperties.getBrokerServiceurl()); -// log.info("消息发布主题【】" + esmProperties.getTopicNames().toString()); -// log.info("消息总线请求envValue【】" + esmProperties.getEvnValue()); -// log.info("消息监听者名称【】" + esmProperties.getListenerName()); -// log.info("接收到消息-----------------------------开始"); -// pulsarConsumer.setConsumerCallback(new ConsumerCallback() { -// public void handle(HtbMessage message){ -// //消息消费处理 -// deptLevlSyncHistoryService.consumeMsg(message); -// } -// }); -// pulsarConsumer.init(); -// } + @Bean + public void syncMsgData() throws Exception{ + HtbPulsarConsumer pulsarConsumer = new HtbPulsarConsumer(); + pulsarConsumer.setBrokerServiceurl(esmProperties.getBrokerServiceurl()); + pulsarConsumer.setAccessToken(esmProperties.getAccessToken()); + pulsarConsumer.setSubscriptionName(esmProperties.getSubscriptionName()); + pulsarConsumer.setListenerName(esmProperties.getListenerName()); + pulsarConsumer.setEnvValue(esmProperties.getEvnValue()); + pulsarConsumer.setTopicNames(esmProperties.getTopicNames()); + pulsarConsumer.setCorePoolSize(esmProperties.getCorePoolSize()); + log.info("消息总线请求url【】" + esmProperties.getBrokerServiceurl()); + log.info("消息发布主题【】" + esmProperties.getTopicNames().toString()); + log.info("消息总线请求envValue【】" + esmProperties.getEvnValue()); + log.info("消息监听者名称【】" + esmProperties.getListenerName()); + log.info("接收到消息-----------------------------开始"); + pulsarConsumer.setConsumerCallback(new ConsumerCallback() { + public void handle(HtbMessage message){ + //消息消费处理 + deptLevlSyncHistoryService.consumeMsg(message); + } + }); + pulsarConsumer.init(); + } } diff --git a/security-service/security-desk/src/main/java/org/security/basicDataSync/entity/UserSyncHistory.java b/security-service/security-desk/src/main/java/org/security/basicDataSync/entity/UserSyncHistory.java index fdfe301..7b7fbf4 100644 --- a/security-service/security-desk/src/main/java/org/security/basicDataSync/entity/UserSyncHistory.java +++ b/security-service/security-desk/src/main/java/org/security/basicDataSync/entity/UserSyncHistory.java @@ -136,4 +136,11 @@ public class UserSyncHistory implements Serializable { @ApiModelProperty(value = "岗位类型 (1-机构负责人,2-安全部门负责人,3-安全员,4-义务消防员,5-其他)") @TableField("CIVILAIR_DEFENSE_TYPE") private String civilAirDefenseType; + + /** + * 是否借调 (0-否 1-是)这个标志由安全管理信息化系统维护员工信息时进行更新,如果是借调的员工,同步消息总线的消息时就不进行同步 + */ + @ApiModelProperty(value = "是否借调 (0-否 1-是)") + @TableField("IS_SECONDED") + private String isSeconded; } diff --git a/security-service/security-desk/src/main/java/org/security/basicDataSync/mapper/DeptLevlSyncHistoryMapper.java b/security-service/security-desk/src/main/java/org/security/basicDataSync/mapper/DeptLevlSyncHistoryMapper.java index 8973d90..b52e1e2 100644 --- a/security-service/security-desk/src/main/java/org/security/basicDataSync/mapper/DeptLevlSyncHistoryMapper.java +++ b/security-service/security-desk/src/main/java/org/security/basicDataSync/mapper/DeptLevlSyncHistoryMapper.java @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.security.basicDataSync.entity.DeptLevlSyncHistory; +import org.security.system.user.entity.User; + +import java.util.List; /** * @author :wzf @@ -24,4 +27,9 @@ public interface DeptLevlSyncHistoryMapper extends BaseMapper getUserNoPassword(); } diff --git a/security-service/security-desk/src/main/java/org/security/basicDataSync/mapper/DeptLevlSyncHistoryMapper.xml b/security-service/security-desk/src/main/java/org/security/basicDataSync/mapper/DeptLevlSyncHistoryMapper.xml index 6fd71cb..d43bfcd 100644 --- a/security-service/security-desk/src/main/java/org/security/basicDataSync/mapper/DeptLevlSyncHistoryMapper.xml +++ b/security-service/security-desk/src/main/java/org/security/basicDataSync/mapper/DeptLevlSyncHistoryMapper.xml @@ -11,4 +11,10 @@ + + + + diff --git a/security-service/security-desk/src/main/java/org/security/basicDataSync/service/IDeptLevlSyncHistoryService.java b/security-service/security-desk/src/main/java/org/security/basicDataSync/service/IDeptLevlSyncHistoryService.java index 237fcbf..f596ded 100644 --- a/security-service/security-desk/src/main/java/org/security/basicDataSync/service/IDeptLevlSyncHistoryService.java +++ b/security-service/security-desk/src/main/java/org/security/basicDataSync/service/IDeptLevlSyncHistoryService.java @@ -1,7 +1,7 @@ package org.security.basicDataSync.service; import com.baomidou.mybatisplus.extension.service.IService; -//import com.ynhtbank.emb.base.message.HtbMessage; +import com.ynhtbank.emb.base.message.HtbMessage; import org.security.basicDataSync.entity.DeptLevlSyncHistory; import org.springframework.web.multipart.MultipartFile; @@ -15,7 +15,7 @@ public interface IDeptLevlSyncHistoryService extends IService userDataList = userSyncHistoryService.list(new QueryWrapper().lambda() -// .eq(Func.isNotEmpty(userDataResponse.getSysHead().getPdcSysSeqNo()), UserSyncHistory::getPdcSysSeqNo, userDataResponse.getSysHead().getPdcSysSeqNo())); -// -// Preconditions.checkArgument(Func.isEmpty(userDataList), "【用户信息同步】消息总线的生产者系统流水号已经存在,本次消息不同步至相关信息表,生产者系统流水号【】" + userDataResponse.getSysHead().getPdcSysSeqNo()); -// log.info("--------------------------用户信息全量同步至blade_user表、blade_user_dept表和t_employee表开始---------------------------"); -// //获取所有启用状态的用户层级信息 -// syncUSerDataInfo(); -// log.info("--------------------------用户信息全量同步至blade_user表、blade_user_dept表和t_employee表结束---------------------------"); -// } -// } - /** * 同步用户信息至lade_user表、blade_user_dept表和t_employee表 */ private void syncUSerDataInfo() { - List userList = userSyncHistoryService.list(new QueryWrapper().lambda().eq(UserSyncHistory::getForbidSts, "1")); + log.info("===========syncUSerDataInfo begin========"); + //查出所有用户启用的 且不是借调状态的(isSeconded 0-非借调 1-借调) + List userList = userSyncHistoryService.list(new QueryWrapper().lambda().eq(UserSyncHistory::getForbidSts, "1").eq(UserSyncHistory::getIsSeconded, "0")); + //查出所有用户禁用的 + List userList2 = userSyncHistoryService.list(new QueryWrapper().lambda().eq(UserSyncHistory::getForbidSts, "2")); if (Func.isNotEmpty(userList)) { + log.info("启用且非借调员工共计【{}】人进行更新",userList.size()); List employeeList = new ArrayList<>(); List userDeptList = new ArrayList<>(); List userInfoList = new ArrayList<>(); @@ -150,17 +132,47 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl { + updateUserPassword(); + }); + log.info("启用且非借调员工共计【{}】人更新完成",userList.size()); } + if (Func.isNotEmpty(userList2)) { + log.info("禁用员工共计【{}】人进行逻辑删除",userList2.size()); + userList2.forEach(item -> { + //删除bladeUser信息 + userClient.removeUserByIds(item.getId()); + //删除employee员工信息 + employeeClient.removeData(item.getId()); + }); + log.info("禁用员工共计【{}】人删除完成",userList2.size()); + } + log.info("===========syncUSerDataInfo end========"); } - + /** + * 给新增用户初始化密码 + */ + private void updateUserPassword(){ + List newUserList = baseMapper.getUserNoPassword(); + if(Func.isNotEmpty(newUserList) && newUserList.size()>0){ + log.info("===========新增用户初始化密码 开始========"); + newUserList.forEach(item->{ + item.setPassword(DigestUtil.encrypt("123456")); + }); + userClient.saveUserData(newUserList); + log.info("===========新增用户初始化密码 结束========"); + } + } /** * UserDept赋值 */ private UserDept setUserDeptData(UserSyncHistory item, User user) { + log.info("=====UserDept赋值:【{}】",item.getEmpeNum()); //UserDept赋值 UserDept userDept = new UserDept(); - userDept.setUserId(Func.isNotEmpty(item.getId()) ? Long.valueOf(item.getId()) : null); + userDept.setUserId(Func.isNotEmpty(item.getId()) ? Long.valueOf(item.getId()) : user.getId()); userDept.setDeptId(Func.isNotEmpty(user.getDeptId()) ? Long.valueOf(user.getDeptId()) : null); return userDept; } @@ -170,15 +182,25 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl().lambda().eq(DeptSyncHistory::getInstiEnc, item.getOrganNo())); - employee.setDeptId(Func.isNotEmpty(deptSyncHistory) ? deptSyncHistory.getId() : null); employee.setGender(item.getGender()); employee.setPhone(user.getPhone()); employee.setEmployeeNo(item.getEmpeNum()); + employee.setBirthday(item.getBirthday()); + employee.setWorkBeginDate(item.getWorkBeginDate()); + employee.setSchool(item.getSchool()); + employee.setEducation(item.getEducation()); + employee.setAddress(item.getAddress()); + employee.setNation(item.getNation()); + employee.setPolitics(item.getPolitics()); + employee.setJobTitle(item.getJobTitle()); + DeptSyncHistory deptSyncHistory = deptSyncHistoryService.getOne(new QueryWrapper().lambda().eq(DeptSyncHistory::getInstiEnc, item.getOrganNo())); + employee.setDeptId(Func.isNotEmpty(deptSyncHistory) ? deptSyncHistory.getId() : null); return employee; } @@ -187,6 +209,7 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl().lambda().eq(DeptSyncHistory::getInstiEnc, item.getOrganNo())); - setUserAimDept(user, deptSyncHistory); + List deptSyncHistorys = deptSyncHistoryService.list(new QueryWrapper().lambda() + .eq(DeptSyncHistory::getInstiEnc, item.getOrganNo()) + .orderByDesc(DeptSyncHistory::getUpdateTime)); + setUserAimDept(user, Func.isNotEmpty(deptSyncHistorys)?deptSyncHistorys.get(0):null); user.setEmail(item.getMaiBx()); user.setPhone(item.getCellPneNum()); user.setSex(Func.isNotEmpty(item.getGender()) ? Integer.valueOf(item.getGender()) : null); user.setStatus(1); + user.setIsDeleted("1".equals(item.getForbidSts())?0:1);// ForbidSts 1-启用 2-禁用 return user; } @@ -210,99 +237,73 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl().lambda().eq(Func.isNotEmpty(parentCode), DeptSyncHistory::getInstiEnc, parentCode)); + DeptSyncHistory deptSyncHistory1 = new DeptSyncHistory(); + if(Func.isNotEmpty(parentCode)){ +// 若有上级机构号,到机构同步流水表中查询对应的上级机构信息 + List deptSyncHistories = deptSyncHistoryService.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(parentCode), DeptSyncHistory::getInstiEnc, parentCode) + .orderByDesc(DeptSyncHistory::getUpdateTime)); + if(Func.isNotEmpty(deptSyncHistories)){ + return deptSyncHistories.get(0); + } + } +// 没有上级机构号则返回空对象 + return deptSyncHistory1; } - - /** - * 将机构信息同步至blade_dept表和t_department表(全量同步t_dept_sync_history表和t_dept_levl_sync_history表中的数据到目标表) - */ -// private void copyDeptDataToAimTable(HtbMessage message) { -// if ((Func.isNotEmpty(message.getTopicName())) && ((Constant.TOPIC_NAME_DEPT_DATA.equals(message.getTopicName().substring(message.getTopicName().indexOf("/") + 1))) -// || (Constant.TOPIC_NAME_DEPT_LEVEL.equals(message.getTopicName().substring(message.getTopicName().indexOf("/") + 1))))) { -// -// DeptDataResponse deptDataResponse = JSONObject.parseObject(message.getMessageInfo(), DeptDataResponse.class); -// -// List deptDataList = deptSyncHistoryService.list(new QueryWrapper().lambda() -// .eq(Func.isNotEmpty(deptDataResponse.getSysHead().getPdcSysSeqNo()), DeptSyncHistory::getPdcSysSeqNo, deptDataResponse.getSysHead().getPdcSysSeqNo())); -// -// DeptLevelResponse deptLevelResponse = JSONObject.parseObject(message.getMessageInfo(), DeptLevelResponse.class); -// -// List deptLevlSyncHistoryList = this.list(new QueryWrapper().lambda() -// .eq(Func.isNotEmpty(deptLevelResponse.getSysHead().getPdcSysSeqNo()), DeptLevlSyncHistory::getPdcSysSeqNo, deptLevelResponse.getSysHead().getPdcSysSeqNo())); -// -// //判断生产者流水号在t_dept_levl_sync_history表和t_dept_sync_history表中是否存在,若存在则不进行数据同步 -// Preconditions.checkArgument(Func.isEmpty(deptDataList), "【机构信息同步】消息总线的生产者系统流水号已经存在,本次消息不同步至相关信息表,生产者系统流水号【】" + deptDataResponse.getSysHead().getPdcSysSeqNo()); -// Preconditions.checkArgument(Func.isEmpty(deptLevlSyncHistoryList), "【机构层级同步】消息总线的生产者系统流水号已经存在,本次消息不同步至相关信息表,生产者系统流水号【】" + deptLevelResponse.getSysHead().getPdcSysSeqNo()); -// -// log.info("--------------------------机构信息全量同步至blade_dept表和t_department表开始---------------------------"); -// syncDeptDataInfo(); -// log.info("--------------------------机构信息全量同步至blade_dept表和t_department表结束---------------------------"); -// } -// } - /** * 同步机构信息至blade_dept表和t_department表 */ private void syncDeptDataInfo() { + log.info("===========syncDeptDataInfo begin========"); //获取所有启用状态的机构层级信息 List deptLevelList = this.list(new QueryWrapper().lambda().eq(DeptLevlSyncHistory::getOrgSte, "0")); +// 获取所有未启用的机构层级信息 + List deptLevelList2 = this.list(new QueryWrapper().lambda().eq(DeptLevlSyncHistory::getOrgSte, "1")); //获取所有启用状态的行政机构信息 List deptInfoList = deptSyncHistoryService.list(new QueryWrapper().lambda().eq(DeptSyncHistory::getOrgSte, "0")); + //获取所有未启用的行政机构信息 + List deptInfoList2 = deptSyncHistoryService.list(new QueryWrapper().lambda().eq(DeptSyncHistory::getOrgSte, "1")); //判断启用状态的机构层级信息和行政机构信息是否为空,若有一个集合为空则不进行同步处理 if (Func.isNotEmpty(deptLevelList) && Func.isNotEmpty(deptInfoList)) { + log.info("启用机构共计【{}】个进行更新",deptInfoList.size()); //组装机构信息数据 List bladeDepartments = new ArrayList<>(); ArrayList departments = new ArrayList<>(); @@ -326,14 +327,26 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl { +// sysClient.synRemoveDeptData(item.getId()); +// departmentClient.removeData(item.getId()); +// }); +// } + log.info("===========syncDeptDataInfo end========"); } /** *同步机构负责人用户的角色id */ private void setUserRoleId(DeptSyncHistory item) { + log.info("====同步机构【{}】的负责人角色id:",item.getInstiEnc()); if (Func.isNotEmpty(item.getPernChrgNum())){ + log.info("====负责人code:【{}】====",item.getPernChrgNum()); R userVOR = userClient.getUserByCode(item.getPernChrgNum()); if (Func.isNotEmpty(userVOR.getData())){ ArrayList userArrayList = new ArrayList<>(); @@ -351,6 +364,7 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl deptLevelList, List deptInfoList, DeptSyncHistory item, Dept dept, Department department) { + log.info("====赋值父级id和祖级id信息:【{}】",item.getInstiEnc()); deptLevelList.forEach(item2 -> { //判断机构号相同项,取出父级机构号 if (item.getInstiEnc().equals(item2.getInstiEnc())) { @@ -373,16 +387,21 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl list, String aimDeptCode) { + log.info("====执行getAncestors方法:【{}】",department.getDeptNo()); while (true) { if (Func.isEmpty(aimDeptCode)){ aimDeptCode = department.getDeptNo(); } //获取机构代码等于aimDeptCode,且机构层级状态为启用状态的数据,该数据一般只存在一条 List deptLevlList = this.list(new QueryWrapper().lambda().eq(Func.isNotEmpty(aimDeptCode),DeptLevlSyncHistory::getInstiEnc,aimDeptCode) - .eq(DeptLevlSyncHistory::getOrgSte,"0")); + .eq(DeptLevlSyncHistory::getOrgSte,"0") + ); if (Func.isEmpty(deptLevlList)){ break; } + if(Func.isEmpty(deptLevlList.get(0).getSprrOrgNum())){ + break; + } DeptSyncHistory history = deptSyncHistoryService.getOne(new QueryWrapper().lambda().eq(Func.isNotEmpty(deptLevlList.get(0).getSprrOrgNum()), DeptSyncHistory::getInstiEnc, deptLevlList.get(0).getSprrOrgNum())); aimDeptCode = deptLevlList.get(0).getSprrOrgNum(); if (Func.isNotEmpty(history)) { @@ -395,6 +414,7 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl().lambda().eq(UserSyncHistory::getOrganNo, department.getDeptNo())).size()); + department.setDelFlag(item.getOrgSte()); +// department.setPeopleNumber(userSyncHistoryService.list(new QueryWrapper().lambda().eq(UserSyncHistory::getOrganNo, department.getDeptNo())).size()); return department; } @@ -417,115 +438,130 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl userDataList = userSyncHistoryService.list(new QueryWrapper().lambda() -// .eq(Func.isNotEmpty(userDataResponse.getSysHead().getPdcSysSeqNo()), UserSyncHistory::getPdcSysSeqNo, userDataResponse.getSysHead().getPdcSysSeqNo())); -// Preconditions.checkArgument(Func.isEmpty(userDataList), "【用户信息同步】消息总线的生产者系统流水号已经存在,本次消息不做入库处理,生产者系统流水号【】" + userDataResponse.getSysHead().getPdcSysSeqNo()); -// //消息入库开始 -// log.info("--------------用户信息入库开始--------------"); -// List sameData = new ArrayList<>(); -// List differentData = new ArrayList<>(); -// List list = userSyncHistoryService.list(); -// List userDatas = userDataResponse.getBody().getInfArray(); -// //给数据赋值相关生产系统流水号 -// userDatas.forEach(item -> { -// item.setPdcSysSeqNo(userDataResponse.getSysHead().getPdcSysSeqNo()); -// }); -// //本地数据库已有行政机构信息 -// if (Func.isNotEmpty(list)) { -// setUpdateUserData(sameData, differentData, list, userDatas); -// //更新和新增消息总线同步的数据 -// if (Func.isNotEmpty(sameData)) { -// userSyncHistoryService.updateBatchById(sameData); -// } -// if (Func.isNotEmpty(differentData)) { -// userSyncHistoryService.saveBatch(differentData); -// } -// log.info("--------------用户信息入库结束--------------"); -// }//第一次接收消息总线同步的消息 -// else { -// userSyncHistoryService.saveBatch(userDatas); -// log.info("--------------【首次】用户信息入库结束--------------"); -// } -// // 用户信息入库完成后即可执行同步动作 -// log.info("--------------------------用户信息全量同步至blade_user表、blade_user_dept表和t_employee表开始---------------------------"); -// //获取所有启用状态的用户层级信息 -// syncUSerDataInfo(); -// log.info("--------------------------用户信息全量同步至blade_user表、blade_user_dept表和t_employee表结束---------------------------"); -// } -// } + private void syncUserData(HtbMessage message) { + if (Func.isNotEmpty(message.getTopicName()) && Constant.TOPIC_NAME_USER_DATA.equals(message.getTopicName().substring(message.getTopicName().indexOf("/") + 1))) { + UserDataResponse userDataResponse = JSONObject.parseObject(message.getMessageInfo(), UserDataResponse.class); + log.info("生产者系统流水号【】" + userDataResponse.getSysHead().getPdcSysSeqNo()); + log.info("--------------消息解析结束--------------"); + //判断生产者系统流水号-PdcSysSeqNo是否存在 + List userDataList = userSyncHistoryService.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(userDataResponse.getSysHead().getPdcSysSeqNo()), UserSyncHistory::getPdcSysSeqNo, userDataResponse.getSysHead().getPdcSysSeqNo())); + Preconditions.checkArgument(Func.isEmpty(userDataList), "【用户信息同步】消息总线的生产者系统流水号已经存在,本次消息不做入库处理,生产者系统流水号【】" + userDataResponse.getSysHead().getPdcSysSeqNo()); + //消息入库开始 + log.info("--------------用户信息入库开始--------------"); + List sameData = new ArrayList<>(); + List differentData = new ArrayList<>(); + List list = userSyncHistoryService.list();//本地t_user_sync_history表中的全部历史数据 + List userDatas = userDataResponse.getBody().getInfArray();//本次总线推送的员工更新/新增数据 + //给数据赋值相关生产系统流水号 + userDatas.forEach(item -> { + item.setPdcSysSeqNo(userDataResponse.getSysHead().getPdcSysSeqNo()); + }); + //本地数据库已有行政机构信息 + if (Func.isNotEmpty(list)) { + setUpdateUserData(sameData, differentData, list, userDatas); + //更新和新增消息总线同步的数据 + if (Func.isNotEmpty(sameData)) { + userSyncHistoryService.updateBatchById(sameData); + } + if (Func.isNotEmpty(differentData)) { + userSyncHistoryService.saveBatch(differentData); + } + log.info("--------------用户信息入库结束--------------"); + }//第一次接收消息总线同步的消息 + else { + userSyncHistoryService.saveBatch(userDatas); + log.info("--------------【首次】用户信息入库结束--------------"); + } + // 用户信息入库完成后即可执行同步动作 + log.info("--------------------------用户信息全量同步至blade_user表、blade_user_dept表和t_employee表开始---------------------------"); + //获取所有启用状态的用户层级信息 + syncUSerDataInfo(); + log.info("--------------------------用户信息全量同步至blade_user表、blade_user_dept表和t_employee表结束---------------------------"); + } + } /** *获取消息总线变更的用户信息 + * @param sameData userDatas与list比对后员工号相同的数据 + * @param differentData userDatas与list比对后员工号不同的数据,即本地没有记录的新增员工 + * @param list 本地t_user_sync_history表中的本次更新前全部历史数据 + * @param userDatas 本次总线推送的员工更新/新增数据 */ private void setUpdateUserData(List sameData, List differentData, List list, List userDatas) { + log.info("--------------------------setUpdateUserData 开始---------------------------"); list.forEach(item -> { //消息总线的生产者系统流水号在本地数据库不存在 userDatas.forEach(item4 -> { + item4.setId(null);//将本次总线推送的数据中的id(如有)置空,避免主键重复 //用户变更数据 - if (item4.getEmpeNum().equals(item.getEmpeNum())) { - item4.setId(item.getId()); + if (item4.getEmpeNum().equals(item.getEmpeNum())) {//员工号相同,说明是老员工 + item4.setId(item.getId());// id沿用 + item4.setIsSeconded(item.getIsSeconded());//‘是否借调’字段需要同步原表的 sameData.add(item4); } }); @@ -538,46 +574,46 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl deptDataList = deptSyncHistoryService.list(new QueryWrapper().lambda() -// .eq(Func.isNotEmpty(deptDataResponse.getSysHead().getPdcSysSeqNo()), DeptSyncHistory::getPdcSysSeqNo, deptDataResponse.getSysHead().getPdcSysSeqNo())); -// Preconditions.checkArgument(Func.isEmpty(deptDataList), "【机构信息同步】消息总线的生产者系统流水号已经存在,本次消息不做入库处理,生产者系统流水号【】" + deptDataResponse.getSysHead().getPdcSysSeqNo()); -// //消息入库开始 -// log.info("--------------行政机构信息入库开始--------------"); -// List sameData = new ArrayList<>(); -// List differentData = new ArrayList<>(); -// List list = deptSyncHistoryService.list(); -// List deptDatas = deptDataResponse.getBody().getInfArray(); -// deptDatas.forEach(item -> { -// item.setUpdateTime(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss")); -// item.setPdcSysSeqNo(deptDataResponse.getSysHead().getPdcSysSeqNo()); -// }); -// //本地数据库已有行政机构信息 -// if (Func.isNotEmpty(list)) { -// setUpdateDeptData(sameData, differentData, list, deptDatas); -// //更新和新增消息总线同步的数据 -// if (Func.isNotEmpty(sameData)) { -// deptSyncHistoryService.updateBatchById(sameData); -// } -// if (Func.isNotEmpty(differentData)) { -// deptSyncHistoryService.saveBatch(differentData); -// } -// log.info("--------------行政机构信息入库结束--------------"); -// }//第一次接收消息总线同步的消息 -// else { -// deptSyncHistoryService.saveBatch(deptDatas); -// log.info("--------------【首次】行政机构信息入库结束--------------"); -// } -// log.info("--------------------------机构信息全量同步至blade_dept表和t_department表开始---------------------------"); -// syncDeptDataInfo(); -// log.info("--------------------------机构信息全量同步至blade_dept表和t_department表结束---------------------------"); -// } -// } + private void syncDeptData(HtbMessage message) { + if (Func.isNotEmpty(message.getTopicName()) && Constant.TOPIC_NAME_DEPT_DATA.equals(message.getTopicName().substring(message.getTopicName().indexOf("/") + 1))) { + DeptDataResponse deptDataResponse = JSONObject.parseObject(message.getMessageInfo(), DeptDataResponse.class); + log.info("生产者系统流水号【】" + deptDataResponse.getSysHead().getPdcSysSeqNo()); + log.info("--------------消息解析结束--------------"); + //判断生产者系统流水号-PdcSysSeqNo是否存在 + List deptDataList = deptSyncHistoryService.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(deptDataResponse.getSysHead().getPdcSysSeqNo()), DeptSyncHistory::getPdcSysSeqNo, deptDataResponse.getSysHead().getPdcSysSeqNo())); + Preconditions.checkArgument(Func.isEmpty(deptDataList), "【机构信息同步】消息总线的生产者系统流水号已经存在,本次消息不做入库处理,生产者系统流水号【】" + deptDataResponse.getSysHead().getPdcSysSeqNo()); + //消息入库开始 + log.info("--------------行政机构信息入库开始--------------"); + List sameData = new ArrayList<>(); + List differentData = new ArrayList<>(); + List list = deptSyncHistoryService.list(); + List deptDatas = deptDataResponse.getBody().getInfArray(); + deptDatas.forEach(item -> { + item.setUpdateTime(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss")); + item.setPdcSysSeqNo(deptDataResponse.getSysHead().getPdcSysSeqNo()); + }); + //本地数据库已有行政机构信息 + if (Func.isNotEmpty(list)) { + setUpdateDeptData(sameData, differentData, list, deptDatas); + //更新和新增消息总线同步的数据 + if (Func.isNotEmpty(sameData)) { + deptSyncHistoryService.updateBatchById(sameData); + } + if (Func.isNotEmpty(differentData)) { + deptSyncHistoryService.saveBatch(differentData); + } + log.info("--------------行政机构信息入库结束--------------"); + }//第一次接收消息总线同步的消息 + else { + deptSyncHistoryService.saveBatch(deptDatas); + log.info("--------------【首次】行政机构信息入库结束--------------"); + } + log.info("--------------------------机构信息全量同步至blade_dept表和t_department表开始---------------------------"); + syncDeptDataInfo(); + log.info("--------------------------机构信息全量同步至blade_dept表和t_department表结束---------------------------"); + } + } /** * 获取消息总线变更行政机构信息 @@ -601,52 +637,53 @@ public class DeptLevlSyncHistoryServiceImpl extends ServiceImpl deptLevlSyncHistoryList = this.list(new QueryWrapper().lambda() -// .eq(Func.isNotEmpty(deptLevelResponse.getSysHead().getPdcSysSeqNo()), DeptLevlSyncHistory::getPdcSysSeqNo, deptLevelResponse.getSysHead().getPdcSysSeqNo())); -// Preconditions.checkArgument(Func.isEmpty(deptLevlSyncHistoryList), "【机构层级同步】消息总线的生产者系统流水号已经存在,本次消息不做入库处理,生产者系统流水号【】" + deptLevelResponse.getSysHead().getPdcSysSeqNo()); -// //消息入库开始 -// log.info("--------------机构层级信息入库开始--------------"); -// List sameData = new ArrayList<>(); -// List differentData = new ArrayList<>(); -// List list = this.list(); -// List deptLevelDatas = deptLevelResponse.getBody().getInfArray(); -// deptLevelDatas.forEach(item -> { -// item.setUpdateTime(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss")); -// item.setPdcSysSeqNo(deptLevelResponse.getSysHead().getPdcSysSeqNo()); -// }); -// //本地数据库已有机构层级信息 -// if (Func.isNotEmpty(list)) { -// setUpdateDeptLevel(sameData, differentData, list, deptLevelDatas); -// //更新和新增消息总线同步的数据 -// if (Func.isNotEmpty(sameData)) { -// this.updateBatchById(sameData); -// } -// if (Func.isNotEmpty(differentData)) { -// this.saveBatch(differentData); -// } -// log.info("--------------机构层级信息入库结束--------------"); -// }//第一次接收消息总线同步的消息 -// else { -// this.saveBatch(deptLevelDatas); -// log.info("--------------【首次】机构层级信息入库结束--------------"); -// } -// log.info("--------------------------机构信息全量同步至blade_dept表和t_department表开始---------------------------"); -// syncDeptDataInfo(); -// log.info("--------------------------机构信息全量同步至blade_dept表和t_department表结束---------------------------"); -// } -// } + private void syncDeptLevelData(HtbMessage message) { + if (Func.isNotEmpty(message.getTopicName()) && Constant.TOPIC_NAME_DEPT_LEVEL.equals(message.getTopicName().substring(message.getTopicName().indexOf("/") + 1))) { + //解析消息 + DeptLevelResponse deptLevelResponse = JSONObject.parseObject(message.getMessageInfo(), DeptLevelResponse.class); + log.info("生产者系统流水号【】" + deptLevelResponse.getSysHead().getPdcSysSeqNo()); + log.info("--------------消息解析结束--------------"); + //判断生产者系统流水号-PdcSysSeqNo是否存在 + List deptLevlSyncHistoryList = this.list(new QueryWrapper().lambda() + .eq(Func.isNotEmpty(deptLevelResponse.getSysHead().getPdcSysSeqNo()), DeptLevlSyncHistory::getPdcSysSeqNo, deptLevelResponse.getSysHead().getPdcSysSeqNo())); + Preconditions.checkArgument(Func.isEmpty(deptLevlSyncHistoryList), "【机构层级同步】消息总线的生产者系统流水号已经存在,本次消息不做入库处理,生产者系统流水号【】" + deptLevelResponse.getSysHead().getPdcSysSeqNo()); + //消息入库开始 + log.info("--------------机构层级信息入库开始--------------"); + List sameData = new ArrayList<>(); + List differentData = new ArrayList<>(); + List list = this.list(); + List deptLevelDatas = deptLevelResponse.getBody().getInfArray(); + deptLevelDatas.forEach(item -> { + item.setUpdateTime(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss")); + item.setPdcSysSeqNo(deptLevelResponse.getSysHead().getPdcSysSeqNo()); + }); + //本地数据库已有机构层级信息 + if (Func.isNotEmpty(list)) { + setUpdateDeptLevel(sameData, differentData, list, deptLevelDatas); + //更新和新增消息总线同步的数据 + if (Func.isNotEmpty(sameData)) { + this.updateBatchById(sameData); + } + if (Func.isNotEmpty(differentData)) { + this.saveBatch(differentData); + } + log.info("--------------机构层级信息入库结束--------------"); + }//第一次接收消息总线同步的消息 + else { + this.saveBatch(deptLevelDatas); + log.info("--------------【首次】机构层级信息入库结束--------------"); + } + log.info("--------------------------机构信息全量同步至blade_dept表和t_department表开始---------------------------"); + syncDeptDataInfo(); + log.info("--------------------------机构信息全量同步至blade_dept表和t_department表结束---------------------------"); + } + } /** *获取消息总线变更的机构层级信息 */ private void setUpdateDeptLevel(List sameData, List differentData, List list, List deptLevelDatas) { + log.info("--------------------------setUpdateDeptLevel 开始---------------------------"); list.forEach(item -> { //消息总线的生产者系统流水号在本地数据库不存在 deptLevelDatas.forEach(item2 -> { diff --git a/security-service/security-desk/src/main/java/org/security/basicDataSync/task/DeskScheduledTasks.java b/security-service/security-desk/src/main/java/org/security/basicDataSync/task/DeskScheduledTasks.java new file mode 100644 index 0000000..9e6529a --- /dev/null +++ b/security-service/security-desk/src/main/java/org/security/basicDataSync/task/DeskScheduledTasks.java @@ -0,0 +1,27 @@ +package org.security.basicDataSync.task; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.security.basicDataSync.service.IDeptLevlSyncHistoryService; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +/** + * @author nantian.yangzhengyu + * @date 2023/12/4 16:56 + */ +@Slf4j +@AllArgsConstructor +@Component +public class DeskScheduledTasks { + private final IDeptLevlSyncHistoryService deptLevlSyncHistoryService; + + @Async("securityDeskThreadPool") + @Scheduled(cron = "${schedule.syncEmpDeptCron}") + public void reopenEmployee(){ + log.info("===============【定时任务】触发手动同步机构员工数据方法==============="); + deptLevlSyncHistoryService.synData(); + log.info("===============【定时任务】手动同步机构员工数据方法完成==============="); + } +} diff --git a/security-service/security-desk/src/main/java/org/security/common/DeskThreadPoolConfig.java b/security-service/security-desk/src/main/java/org/security/common/DeskThreadPoolConfig.java new file mode 100644 index 0000000..3c7d499 --- /dev/null +++ b/security-service/security-desk/src/main/java/org/security/common/DeskThreadPoolConfig.java @@ -0,0 +1,26 @@ +package org.security.common; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.ThreadPoolExecutor; + +/** + * @author nantian.yangzhengyu + * @date 2023/12/4 17:35 + */ +@Configuration +public class DeskThreadPoolConfig { + + @Bean + public ThreadPoolTaskExecutor securityDeskThreadPool() { + ThreadPoolTaskExecutor poolTaskExecutor = new ThreadPoolTaskExecutor(); + poolTaskExecutor.setCorePoolSize(Runtime.getRuntime().availableProcessors()); + poolTaskExecutor.setMaxPoolSize(1000); + poolTaskExecutor.setKeepAliveSeconds(60 * 3); + poolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + poolTaskExecutor.setThreadNamePrefix("security-desk-htread-"); + return poolTaskExecutor; + } +} diff --git a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/controller/DownloadFileController.java b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/controller/DownloadFileController.java index c876c18..d4222ec 100644 --- a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/controller/DownloadFileController.java +++ b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/controller/DownloadFileController.java @@ -51,6 +51,7 @@ public class DownloadFileController { res.setHeader("content-type", "application/octet-stream"); res.setHeader("Content-Disposition", "attachment;filename=\"" + filename+"\""); res.setHeader("Set-Cookie","HttpOnly"); + res.setHeader("content-length", String.valueOf(file.length())); res.setContentType("application/octet-stream"); byte[] buff = new byte[1024]; BufferedInputStream bis = null; @@ -67,10 +68,9 @@ public class DownloadFileController { } else { bis = new BufferedInputStream(fileInputStream); } - int i = bis.read(buff); - while (-1 != i) { - os.write(buff, 0, buff.length); - i = bis.read(buff); + int len = 0; + while ((len = bis.read(buff)) > 0) { + os.write(buff, 0, len); } os.flush(); } catch (Exception e) { diff --git a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/controller/UploadFileController.java b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/controller/UploadFileController.java index 0ba2534..ab585d5 100644 --- a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/controller/UploadFileController.java +++ b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/controller/UploadFileController.java @@ -56,7 +56,18 @@ public class UploadFileController { return R.data(uploadFileService.getData(busiBeginDate,contentId,fileName)); } - + /** + * 获取影像平台文件url + * @param busiBeginDate 业务开始时间 + * @param contentId 文件在影像平台存储标识id + * @return + */ + @GetMapping("/fileURL") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "获取影像平台文件url") + public R getFileURL(@RequestParam String busiBeginDate, @RequestParam String contentId) throws IOException { + return R.data(uploadFileService.getFileUrl(busiBeginDate,contentId)); + } /** * 删除影像平台文件 * @param busiBeginDate 业务开始时间 @@ -84,6 +95,6 @@ public class UploadFileController { @RequestParam String groupName, @RequestParam String fileType, @RequestParam(required = false) Boolean encrypt) { - return R.data(uploadFileService.sendImagesPlateFormDock(files,groupName,fileType,encrypt)); + return uploadFileService.sendImagesPlateFormDock(files,groupName,fileType,encrypt); } } diff --git a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/imagePlateform/SunECMClient.java b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/imagePlateform/SunECMClient.java index 8a58747..75615b2 100644 --- a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/imagePlateform/SunECMClient.java +++ b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/imagePlateform/SunECMClient.java @@ -206,7 +206,7 @@ public class SunECMClient { * @param contentId 附件平台id * @return 影像平台请求返回结果 */ - private String getPlateFormFile(String busiBeginDate, String contentId) { + public String getPlateFormFile(String busiBeginDate, String contentId) { SunEcmClientApi sec = new SunEcmClientSocketApiImpl(imagePlateFormDockProperties.getIp(), imagePlateFormDockProperties.getSocketPort()); //初始化, ClientBatchBean clientBatchBean = new ClientBatchBean(); clientBatchBean.setModelCode(imagePlateFormDockProperties.getModelCode()); @@ -219,7 +219,7 @@ public class SunECMClient { try { result = sec.queryBatch(clientBatchBean, imagePlateFormDockProperties.getDM()); log.info("影像平台返回结果:[{}]" + result); - log.info("------------------获取影像平台附件开始--------------------"); + log.info("------------------获取影像平台附件结束--------------------"); } catch (Exception e) { e.printStackTrace(); } diff --git a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/service/IUploadFileService.java b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/service/IUploadFileService.java index 875cafc..02f33a7 100644 --- a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/service/IUploadFileService.java +++ b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/service/IUploadFileService.java @@ -24,10 +24,16 @@ public interface IUploadFileService { */ String getData(String busiBeginDate, String contentId,String fileName) throws IOException; + /** + *获取影像平台附件url + * @return + */ + String getFileUrl(String busiBeginDate, String contentId) throws IOException; + /** *上传多个文件 */ - List sendImagesPlateFormDock(List files, String groupName, String fileType, Boolean encrypt); + R> sendImagesPlateFormDock(List files, String groupName, String fileType, Boolean encrypt); /** * 删除影像平台附件 diff --git a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/service/impl/UploadFileServiceImpl.java b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/service/impl/UploadFileServiceImpl.java index 776db54..c2b497b 100644 --- a/security-service/security-desk/src/main/java/org/security/imagePlatformDock/service/impl/UploadFileServiceImpl.java +++ b/security-service/security-desk/src/main/java/org/security/imagePlatformDock/service/impl/UploadFileServiceImpl.java @@ -1,6 +1,10 @@ package org.security.imagePlatformDock.service.impl; import cn.hutool.core.date.DateUtil; +import com.sunyard.client.bean.ClientBatchBean; +import com.sunyard.client.bean.ClientBatchFileBean; +import com.sunyard.client.bean.ClientFileBean; +import com.sunyard.ws.utils.XMLUtil; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; @@ -12,6 +16,7 @@ import org.security.imagePlatformDock.entity.UploadFileRecord; import org.security.imagePlatformDock.imagePlateform.SunECMClient; import org.security.imagePlatformDock.service.IUploadFileRecordService; import org.security.imagePlatformDock.service.IUploadFileService; +import org.springblade.core.log.exception.ServiceException; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.stereotype.Service; @@ -101,8 +106,9 @@ public class UploadFileServiceImpl implements IUploadFileService { //将上传记录放入影像平台流水记录表 log.info("将附件上传影像平台记录保存至影像平台流水记录表中,记录信息:{[]}" + uploadFileRecord); boolean b = uploadFileRecordService.save(uploadFileRecord); + log.info("上传文件流水记录表保存结果:{[]}" + b); //上传影像平台成功 - if ("1".equals(uploadFileRecord.getUploadState()) && b) { + if ("1".equals(uploadFileRecord.getUploadState())) { return R.data(UploadVO.builder() .name(fileName) .contentId(uploadFileRecord.getContentId()) @@ -114,8 +120,11 @@ public class UploadFileServiceImpl implements IUploadFileService { .build()); }//上传影像平台失败或上传影像平台记录保存失败 else { - log.info("上传影像平台失败或上传影像平台记录保存失败,上传内容:{[]}" + b); - return R.fail("文件上传影像平台失败"); + if(Func.isNull(uploadFileRecord.getResult())){ + return R.fail("文件上传影像平台失败,无法获取影像平台响应结果!"); + } + return R.fail("文件上传影像平台失败:"+uploadFileRecord.getResult()); + } } @@ -124,18 +133,50 @@ public class UploadFileServiceImpl implements IUploadFileService { return sunECMClient.getFileData(busiBeginDate,contentId,fileName); } + /** + * 获取影像平台附件链接 + * @param busiBeginDate + * @param contentId + * @return + * @throws IOException + */ @Override - public List sendImagesPlateFormDock(List files, String groupName, String fileType, Boolean encrypt) { + public String getFileUrl(String busiBeginDate, String contentId) throws IOException { + String result = sunECMClient.getPlateFormFile(busiBeginDate,contentId); + String url = ""; + if (result != null && result.startsWith("0001<<::>>")) { + String rspXml = result.substring(result.indexOf(" clientBatchFileBeans = clientBatchBean2.getDocument_Objects(); + for (ClientBatchFileBean clientBatchFileBeas : clientBatchFileBeans) { + List ClientFileBean = clientBatchFileBeas.getFiles(); + for (ClientFileBean clientFileBean : ClientFileBean) { + url = clientFileBean.getUrl(); + } + } + log.info("影像平台 URL {}", url); + } + return url; + } + + @Override + public R> sendImagesPlateFormDock(List files, String groupName, String fileType, Boolean encrypt) { ArrayList vos = new ArrayList<>(); if (Func.isNotEmpty(files)){ files.forEach(item->{ R uploadVOR = this.sendImagePlateFormDock(item, groupName, fileType, encrypt); - if (Func.isNotEmpty(uploadVOR.getData())){ + log.info("uploadVOR:{}",uploadVOR); + if(!uploadVOR.isSuccess()){ + throw new ServiceException(uploadVOR.getMsg()); + } + else if (Func.isNotEmpty(uploadVOR.getData())){ vos.add(uploadVOR.getData()); } }); } - return vos; + return R.data(vos); } @Override diff --git a/security-service/security-desk/src/main/resources/log/logback-dev.xml b/security-service/security-desk/src/main/resources/log/logback-dev.xml index 5ef3075..fdc1c1b 100644 --- a/security-service/security-desk/src/main/resources/log/logback-dev.xml +++ b/security-service/security-desk/src/main/resources/log/logback-dev.xml @@ -31,9 +31,9 @@ ${logdir}/${txcode}.%d{yyyy-MM-dd}.%i.log - 20 - 5MB - 1024MB + 100 + 50MB + 2048MB diff --git a/security-service/security-desk/src/main/resources/log/logback-prod.xml b/security-service/security-desk/src/main/resources/log/logback-prod.xml index 5ef3075..fdc1c1b 100644 --- a/security-service/security-desk/src/main/resources/log/logback-prod.xml +++ b/security-service/security-desk/src/main/resources/log/logback-prod.xml @@ -31,9 +31,9 @@ ${logdir}/${txcode}.%d{yyyy-MM-dd}.%i.log - 20 - 5MB - 1024MB + 100 + 50MB + 2048MB diff --git a/security-service/security-desk/src/main/resources/log/logback-test.xml b/security-service/security-desk/src/main/resources/log/logback-test.xml index 5ef3075..fdc1c1b 100644 --- a/security-service/security-desk/src/main/resources/log/logback-test.xml +++ b/security-service/security-desk/src/main/resources/log/logback-test.xml @@ -31,9 +31,9 @@ ${logdir}/${txcode}.%d{yyyy-MM-dd}.%i.log - 20 - 5MB - 1024MB + 100 + 50MB + 2048MB