已修改18个文件
已添加107个文件
已复制1个文件
已删除1个文件
已重命名2个文件
10692 ■■■■■ 文件已修改
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/EmergencyRpcAPi.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/req/EmergencydrillTimeRPCReq.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteDepLevelLasTimeRPCRespDTO.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteLastTimeRPCRespDTO.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteTimeRPCRespDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-rpc-provider/src/main/java/com/gkhy/safePlatform/emergency/rpc/provider/EmergencyRpcProvider.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencyCountController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/model/dto/resp/EmergencyExecuteDepLevelLasTimeRespDTO.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/model/dto/resp/EmergencyExecuteLastTimeRespDTO.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/query/EmergencyDrillTimeQuery.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/repository/EmergencyDrillExecuteInfoRepository.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/EmergencyCountService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/EmergencyDrillExecuteInfoService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/impl/EmergencyDrillExecuteInfoServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/impl/EmergencyCountServiceImpl.java 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-service/src/main/resources/config/mapper/emergency/EmergencyDrillExecuteInfoMapper.xml 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/pom.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/EquipmentDemoRpcAPi.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/EquipmentRpcAPi.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/req/MaterialReceiveRecordsRPCReq.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/req/MaterialSpwDeliveryRPCReq.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/req/MaterialSpwRPCReq.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/MaterialReceiveRecordsRPCRespDto.java 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/SafeMaterialBsClassifyRPCRespDto.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/SafeMaterialClassifyRPCRespDto.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/SafeMaterialClassifyStockRPCRespDto.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/SafeRfidMaterialDetailRPCRespDto.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-rpc-provider/src/main/java/com/gkhy/safePlatform/equipment/rpc/provider/EquipmentRpcProvider.java 239 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/common/RocketMQTemplateHelper.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/MaterialClassifyController.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialController.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialDetailController.java 170 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialReceiveRecordsController.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialDeliveryRecordDO.java 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsBO.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsBaseBO.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsBaseDO.java 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsBaseInfo.java 226 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsDO.java 207 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsInfo.java 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialBO.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialBatchDeliveryBO.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialClassifyDO.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialClassifyInfo.java 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialClassifyStockDO.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialCountDO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDO.java 242 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDetailCountDO.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDetailDO.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDetailInfo.java 327 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDetailInfoDO.java 261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialInfo.java 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/ConsumableEnum.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/EquipmentResultCodes.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/IssueReceiptEnum.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/MaterialReceiveRecordsStatusEnum.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/MaterialRevertStatusEnum.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/MaterialStatusEnum.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/ValidStatusEnum.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/ValidTypeEnum.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/excepiton/EquipmentException.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/handler/MyMetaObjectHandler.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialClassifyQuery.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialReceiveRecordsBaseReq.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialReceiveRecordsQuery.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialReceiveRecordsReq.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialSpwDeliveryReq.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialSpwReq.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MterialDeliveryReq.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MterialRandomDeliveryReq.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/ParamForm.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialAddReq.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialClassifyAddReq.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialClassifyModReq.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialClassifyQuery.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialDetailAddReq.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialDetailReq.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialModReq.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialQuery.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMatetrialDetailQuery.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/db/SafeMaterialDetailDBQuery.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/BaseMaterialDto.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/MaterialClassificationDto.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/MaterialDepartmentDto.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/MaterialReceiveRecordsBaseDto.java 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/MaterialReceiveRecordsDto.java 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeMaterialClassifyDto.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeMaterialClassifyStockDto.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeMaterialDetailDto.java 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeMaterialDto.java 150 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeRfidMaterialDetailDto.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/mq/consumer/SafeMaterialConsumer.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/mq/msg/SafeMaterialMsg.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/MaterialReceiveRecordsBaseInfoRepository.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/MaterialReceiveRecordsInfoRepository.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/SafeMaterialClassifyInfoRepository.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/SafeMaterialDetailInfoRepository.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/SafeMaterialInfoRepository.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/schedule/KeepAliveRobot.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/MaterialClassifyService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/MaterialReceiveRecordsService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/SafeMaterialDetailService.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/SafeMaterialService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/MaterialReceiveRecordsBaseInfoService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/MaterialReceiveRecordsInfoService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/SafeMaterialClassifyInfoService.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/SafeMaterialDetailInfoService.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/SafeMaterialInfoService.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/MaterialReceiveRecordsBaseInfoServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/MaterialReceiveRecordsInfoServiceImpl.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialClassifyInfoServiceImpl.java 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialDetailInfoServiceImpl.java 213 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialInfoServiceImpl.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/impl/MaterialClassifyServiceImpl.java 294 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/impl/MaterialReceiveRecordsServiceImpl.java 219 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/impl/SafeMaterialDetailServiceImpl.java 1196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/impl/SafeMaterialServiceImpl.java 397 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/resources/config/mapper/equipment/MaterialReceiveRecordsBaseInfoMapper.xml 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/resources/config/mapper/equipment/MaterialReceiveRecordsInfoMapper.xml 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/resources/config/mapper/equipment/SafeMaterialClassifyInfoMapper.xml 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/resources/config/mapper/equipment/SafeMaterialDetailInfoMapper.xml 359 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
equipment/equipment-service/src/main/resources/config/mapper/equipment/SafeMaterialInfoMapper.xml 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/database/MyBatisConfigEquipment.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/exception/GlobalExceptionHandler.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/resources/config/application-dev.yaml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/resources/config/application-guotai-demo.yaml 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/resources/config/application-online-uat.yaml 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
safePlatfrom-out-web/src/main/resources/config/application.yaml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/EmergencyRpcAPi.java
@@ -7,6 +7,7 @@
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteCountRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteNumRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteTimeRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencydrillTimeRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.resp.*;
@@ -36,10 +37,16 @@
    /*****************************************重构***********************************************************/
    // RPC接口--1、传入部门ID,查询该部门最后一次完成应急演练的时间
    ResultVO<EmergencyExecuteLastTimeRPCResp> getExecuteLastTimeByDeptId(Long depId);
    ResultVO<EmergencyExecuteTimeRPCRespDTO> getExecuteLastTimeByDeptId(Long depId);
    // RPC接口--2、传入部门ID,查询该部门以及子级部门中最后一次完成应急演练的时间
    ResultVO<EmergencyExecuteLastTimeRPCResp> getExecuteLastTimeByDeptIds(Long depId);
    ResultVO<List<EmergencyExecuteDepLevelLasTimeRPCRespDTO>> getExecuteLastTimeByDeptIds(Long depId);
    // RPC接口--1、传入部门ID,指定年份,月份,查询该部门最后一次完成应急演练的时间
    ResultVO<EmergencyExecuteLastTimeRPCRespDTO> getExecuteLastTimeByDeptIdAndTime(EmergencydrillTimeRPCReq query);
    // RPC接口--2、传入部门ID,,指定年份,月份,查询该部门以及子级部门中最后一次完成应急演练的时间
    ResultVO<List<EmergencyExecuteDepLevelLasTimeRPCRespDTO>> getExecuteLastTimeByDeptIdsAndTime(EmergencydrillTimeRPCReq query);
    // RPC接口--3、传入部门ID,指定月份 ,统计演练次数
    ResultVO<StatisticsDepLevelMonthEexcuteRPCRespDTO> getExecuteCountByDeptIdAndMonth(EmergencyExecuteCountRPCReq query);
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/req/EmergencydrillTimeRPCReq.java
对比新文件
@@ -0,0 +1,35 @@
package com.gkhy.safePlatform.emergency.rpc.api.model.dto.req;
public class EmergencydrillTimeRPCReq {
    //部门id
    private Long deptId;
    //年份
    private Integer year;
    //月份
    private Integer month;
    public Long getDeptId() {
        return deptId;
    }
    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }
    public Integer getYear() {
        return year;
    }
    public void setYear(Integer year) {
        this.year = year;
    }
    public Integer getMonth() {
        return month;
    }
    public void setMonth(Integer month) {
        this.month = month;
    }
}
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteDepLevelLasTimeRPCRespDTO.java
对比新文件
@@ -0,0 +1,44 @@
package com.gkhy.safePlatform.emergency.rpc.api.model.dto.resp;
public class EmergencyExecuteDepLevelLasTimeRPCRespDTO {
    //部门等级
    private Byte depLevel;
    //年
    private Integer year;
    //月
    private Integer month;
    //最后一次演练时间
    private String LastPricateTime;
    public Byte getDepLevel() {
        return depLevel;
    }
    public void setDepLevel(Byte depLevel) {
        this.depLevel = depLevel;
    }
    public Integer getYear() {
        return year;
    }
    public void setYear(Integer year) {
        this.year = year;
    }
    public Integer getMonth() {
        return month;
    }
    public void setMonth(Integer month) {
        this.month = month;
    }
    public String getLastPricateTime() {
        return LastPricateTime;
    }
    public void setLastPricateTime(String lastPricateTime) {
        LastPricateTime = lastPricateTime;
    }
}
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteLastTimeRPCRespDTO.java
copy from emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteLastTimeRPCResp.java copy to emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteLastTimeRPCRespDTO.java
文件从 emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteLastTimeRPCResp.java 复制
@@ -1,15 +1,17 @@
package com.gkhy.safePlatform.emergency.rpc.api.model.dto.resp;
/**
 * 应急演练时间
 */
public class EmergencyExecuteLastTimeRPCResp {
public class EmergencyExecuteLastTimeRPCRespDTO {
    // 部门id
    private Long depId;
    // 部门级别
    private Byte depLevel;
    //年份
    private Integer year;
    //月份
    private Integer month;
    //左后一次演练的时间
    private String lastPricticeTime;
@@ -30,6 +32,22 @@
        this.depLevel = depLevel;
    }
    public Integer getYear() {
        return year;
    }
    public void setYear(Integer year) {
        this.year = year;
    }
    public Integer getMonth() {
        return month;
    }
    public void setMonth(Integer month) {
        this.month = month;
    }
    public String getLastPricticeTime() {
        return lastPricticeTime;
    }
emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteTimeRPCRespDTO.java
文件名从 emergency/emergency-rpc-api/src/main/java/com/gkhy/safePlatform/emergency/rpc/api/model/dto/resp/EmergencyExecuteLastTimeRPCResp.java 修改
@@ -3,7 +3,7 @@
/**
 * 应急演练时间
 */
public class EmergencyExecuteLastTimeRPCResp {
public class EmergencyExecuteTimeRPCRespDTO {
    // 部门id
    private Long depId;
emergency/emergency-rpc-provider/src/main/java/com/gkhy/safePlatform/emergency/rpc/provider/EmergencyRpcProvider.java
@@ -10,10 +10,12 @@
import com.gkhy.safePlatform.emergency.excepiton.EmergencyException;
import com.gkhy.safePlatform.emergency.model.dto.resp.*;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillCountQuery;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillTimeQuery;
import com.gkhy.safePlatform.emergency.rpc.api.EmergencyRpcAPi;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteCountRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteNumRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteTimeRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencydrillTimeRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.resp.*;
import com.gkhy.safePlatform.emergency.service.EmergencyCountService;
import com.gkhy.safePlatform.emergency.service.EmergencySuppliesService;
@@ -106,10 +108,10 @@
    }
    @Override
    public ResultVO<EmergencyExecuteLastTimeRPCResp> getExecuteLastTimeByDeptId(Long depId) {
        ResultVO<EmergencyExecuteLastTimeRPCResp> result = new ResultVO<>(ResultCodes.OK);
    public ResultVO<EmergencyExecuteTimeRPCRespDTO> getExecuteLastTimeByDeptId(Long depId) {
        ResultVO<EmergencyExecuteTimeRPCRespDTO> result = new ResultVO<>(ResultCodes.OK);
        try{
            EmergencyExecuteLastTimeRPCResp lastTimeRPCResp = new EmergencyExecuteLastTimeRPCResp();
            EmergencyExecuteTimeRPCRespDTO lastTimeRPCResp = new EmergencyExecuteTimeRPCRespDTO();
            EmergencyExecuteTimeRespDTO timeRespDTO = emergencyCountService.getLastTimeByDeptId(depId);
            if(null != timeRespDTO){
                BeanUtils.copyProperties(timeRespDTO,lastTimeRPCResp);
@@ -125,11 +127,40 @@
        return result;
    }
    @Override
    public ResultVO<EmergencyExecuteLastTimeRPCResp> getExecuteLastTimeByDeptIds(Long depId) {
        ResultVO<EmergencyExecuteLastTimeRPCResp> result = new ResultVO<>(ResultCodes.OK);
    public ResultVO<List<EmergencyExecuteDepLevelLasTimeRPCRespDTO>> getExecuteLastTimeByDeptIds(Long depId) {
        ResultVO<List<EmergencyExecuteDepLevelLasTimeRPCRespDTO>> result = new ResultVO<>(ResultCodes.OK);
        try{
            EmergencyExecuteLastTimeRPCResp lastTimeRPCResp = new EmergencyExecuteLastTimeRPCResp();
            EmergencyExecuteTimeRespDTO timeRespDTO = emergencyCountService.getLastTimeByDeptIds(depId);
            List<EmergencyExecuteDepLevelLasTimeRespDTO> lasTimeRespDTOS = emergencyCountService.getLastTimeByDeptIds(depId);
            List<EmergencyExecuteDepLevelLasTimeRPCRespDTO> timeRPCRespDTOS = new ArrayList<>();
            for(EmergencyExecuteDepLevelLasTimeRespDTO timeRespDTO:lasTimeRespDTOS){
                if(timeRespDTO != null){
                    EmergencyExecuteDepLevelLasTimeRPCRespDTO timeRPCRespDTO = new EmergencyExecuteDepLevelLasTimeRPCRespDTO();
                    BeanUtils.copyProperties(timeRespDTO,timeRPCRespDTO);
                    timeRPCRespDTOS.add(timeRPCRespDTO);
                }
            }
            result.setData(timeRPCRespDTOS);
        }catch (EmergencyException e){
            result.setCode(e.getCode());
            result.setMsg(e.getMessage());
        }catch (Exception e) {
            result.setCode(EmergencyResultCodes.ERROR.getCode());
            result.setMsg(EmergencyResultCodes.ERROR.getDesc());
        }
        return result;
    }
    @Override
    public ResultVO<EmergencyExecuteLastTimeRPCRespDTO> getExecuteLastTimeByDeptIdAndTime(EmergencydrillTimeRPCReq query) {
        ResultVO<EmergencyExecuteLastTimeRPCRespDTO> result = new ResultVO<>(ResultCodes.OK);
        EmergencyDrillTimeQuery timeQuery = new EmergencyDrillTimeQuery();
        timeQuery.setDeptId(query.getDeptId());
        timeQuery.setYear(query.getYear());
        timeQuery.setMonth(query.getMonth());
        try{
            EmergencyExecuteLastTimeRPCRespDTO lastTimeRPCResp = new EmergencyExecuteLastTimeRPCRespDTO();
            EmergencyExecuteLastTimeRespDTO timeRespDTO = emergencyCountService.getLastPracticeTimeByDeptIdAndTime(timeQuery);
            if(null != timeRespDTO){
                BeanUtils.copyProperties(timeRespDTO,lastTimeRPCResp);
            }
@@ -145,6 +176,35 @@
    }
    @Override
    public ResultVO<List<EmergencyExecuteDepLevelLasTimeRPCRespDTO>> getExecuteLastTimeByDeptIdsAndTime(EmergencydrillTimeRPCReq query) {
        ResultVO<List<EmergencyExecuteDepLevelLasTimeRPCRespDTO>> result = new ResultVO<>(ResultCodes.OK);
        EmergencyDrillTimeQuery timeQuery = new EmergencyDrillTimeQuery();
        timeQuery.setDeptId(query.getDeptId());
        timeQuery.setYear(query.getYear());
        timeQuery.setMonth(query.getMonth());
        try{
            List<EmergencyExecuteDepLevelLasTimeRPCRespDTO> levelLasTimeRPCRespDTOS = new ArrayList<>();
            List<EmergencyExecuteDepLevelLasTimeRespDTO> lasTimeRespDTOS = emergencyCountService.getLastPracticeTimeByDeptIdsAndTime(timeQuery);
            for(EmergencyExecuteDepLevelLasTimeRespDTO lastTimeRPCRespDTO :lasTimeRespDTOS){
                if(null != lastTimeRPCRespDTO){
                    EmergencyExecuteDepLevelLasTimeRPCRespDTO levelLasTimeRPCRespDTO = new EmergencyExecuteDepLevelLasTimeRPCRespDTO();
                    BeanUtils.copyProperties(lastTimeRPCRespDTO,levelLasTimeRPCRespDTO);
                    levelLasTimeRPCRespDTOS.add(levelLasTimeRPCRespDTO);
                }
            }
            result.setData(levelLasTimeRPCRespDTOS);
        }catch (EmergencyException e){
            result.setCode(e.getCode());
            result.setMsg(e.getMessage());
        }catch (Exception e) {
            result.setCode(EmergencyResultCodes.ERROR.getCode());
            result.setMsg(EmergencyResultCodes.ERROR.getDesc());
        }
        return result;
    }
    @Override
    public ResultVO<StatisticsDepLevelMonthEexcuteRPCRespDTO> getExecuteCountByDeptIdAndMonth(EmergencyExecuteCountRPCReq query) {
        ResultVO<StatisticsDepLevelMonthEexcuteRPCRespDTO> result = new ResultVO<>(ResultCodes.OK);
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/controller/EmergencyCountController.java
@@ -8,6 +8,7 @@
import com.gkhy.safePlatform.emergency.model.dto.resp.*;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillCountQuery;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteCountQuery;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillTimeQuery;
import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteNumRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteTimeRPCReq;
@@ -90,12 +91,27 @@
     * 根据部门以及子级部门查询最后一次完成应急演练的时间
     */
    @RequestMapping(value = "/getLastTimeByDeptIds",method = RequestMethod.POST)
    public EmergencyExecuteTimeRespDTO getLastTimeByDeptIds(@RequestBody JSONObject jsonObject){
    public List<EmergencyExecuteDepLevelLasTimeRespDTO> getLastTimeByDeptIds(@RequestBody JSONObject jsonObject){
        Long deptId = jsonObject.getLong("deptId");
        return emergencyCountService.getLastTimeByDeptIds(deptId);
    }
    /**
     * 根据部门id,年份月份,查询最后一次完成应急演练的时间
     */
    @RequestMapping(value = "/getLastTimeByDeptIdAndTime",method = RequestMethod.POST)
    public EmergencyExecuteLastTimeRespDTO getLastTimeByDeptIdAndTime(@RequestBody EmergencyDrillTimeQuery query){
        return emergencyCountService.getLastPracticeTimeByDeptIdAndTime(query);
    }
    /**
     * 根据部门以及子级部门,年份月份,查询最后一次完成应急演练的时间
     */
    @RequestMapping(value = "/getLastTimeByDeptIdsAndTime",method = RequestMethod.POST)
    public List<EmergencyExecuteDepLevelLasTimeRespDTO> getLastTimeByDeptIdsAndTime(@RequestBody EmergencyDrillTimeQuery query){
        return emergencyCountService.getLastPracticeTimeByDeptIdsAndTime(query);
    }
    /**
     * 根据指定和年份统计演练数据
     * @param query
     * @return
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/model/dto/resp/EmergencyExecuteDepLevelLasTimeRespDTO.java
对比新文件
@@ -0,0 +1,44 @@
package com.gkhy.safePlatform.emergency.model.dto.resp;
public class EmergencyExecuteDepLevelLasTimeRespDTO {
    //部门等级
    private Byte depLevel;
    //年
    private Integer year;
    //月
    private Integer month;
    //最后一次演练时间
    private String LastPricateTime;
    public Byte getDepLevel() {
        return depLevel;
    }
    public void setDepLevel(Byte depLevel) {
        this.depLevel = depLevel;
    }
    public Integer getYear() {
        return year;
    }
    public void setYear(Integer year) {
        this.year = year;
    }
    public Integer getMonth() {
        return month;
    }
    public void setMonth(Integer month) {
        this.month = month;
    }
    public String getLastPricateTime() {
        return LastPricateTime;
    }
    public void setLastPricateTime(String lastPricateTime) {
        LastPricateTime = lastPricateTime;
    }
}
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/model/dto/resp/EmergencyExecuteLastTimeRespDTO.java
对比新文件
@@ -0,0 +1,58 @@
package com.gkhy.safePlatform.emergency.model.dto.resp;
public class EmergencyExecuteLastTimeRespDTO {
    // 部门id
    private Long depId;
    // 部门级别
    private Byte depLevel;
    //年份
    private Integer year;
    //月份
    private Integer month;
    //左后一次演练的时间
    private String lastPricticeTime;
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public Byte getDepLevel() {
        return depLevel;
    }
    public void setDepLevel(Byte depLevel) {
        this.depLevel = depLevel;
    }
    public Integer getYear() {
        return year;
    }
    public void setYear(Integer year) {
        this.year = year;
    }
    public Integer getMonth() {
        return month;
    }
    public void setMonth(Integer month) {
        this.month = month;
    }
    public String getLastPricticeTime() {
        return lastPricticeTime;
    }
    public void setLastPricticeTime(String lastPricticeTime) {
        this.lastPricticeTime = lastPricticeTime;
    }
}
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/query/EmergencyDrillTimeQuery.java
对比新文件
@@ -0,0 +1,35 @@
package com.gkhy.safePlatform.emergency.query;
public class EmergencyDrillTimeQuery {
    //部门id
    private Long deptId;
    //年份
    private Integer year;
    //月份
    private Integer month;
    public Long getDeptId() {
        return deptId;
    }
    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }
    public Integer getYear() {
        return year;
    }
    public void setYear(Integer year) {
        this.year = year;
    }
    public Integer getMonth() {
        return month;
    }
    public void setMonth(Integer month) {
        this.month = month;
    }
}
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/repository/EmergencyDrillExecuteInfoRepository.java
@@ -38,7 +38,7 @@
    String getLastTimeByDeptId(@Param("deptId")Long deptId);
    String getLastTimeByDeptIds(@Param("deptIdList")List<Long> deptIdList);
    List<EmergencyDrillExecuteLastTimeDO> getLastTimeByDeptIds(@Param("deptIdList")List<Long> deptIdList);
    List<EmergencyExecuteCountDO> getCountByDeptIdsAndTime(@Param("startTime")String startTime, @Param("endTime")String endTime, @Param("deptIds")List<Long> deptIds);
@@ -46,4 +46,7 @@
    List<EmergencyExecuteCountDO> getCountByDeptIdAndYear(@Param("year")Integer year, @Param("deptId")Long deptId);
    List<EmergencyDrillExecuteLastTimeDO> getLastTimeByDeptIdsAndTime(@Param("deptIdList")List<Long> deptIdList, @Param("startTime")String startTime, @Param("endTime")String endTime);
    String getLastTimeByDeptIdAndTime(@Param("deptId")Long deptId, @Param("startTime")String startTime, @Param("endTime")String endTime);
}
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/EmergencyCountService.java
@@ -6,6 +6,7 @@
import com.gkhy.safePlatform.emergency.model.dto.resp.*;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillCountQuery;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteCountQuery;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillTimeQuery;
import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteNumRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteTimeRPCReq;
@@ -38,7 +39,7 @@
    //根据部门id查询最后一次完成应急演练的时间
    EmergencyExecuteTimeRespDTO getLastTimeByDeptId(Long deptId);
    //根据部门id查询该部门以及其子级部门最后一次完成应急演练的时间
    EmergencyExecuteTimeRespDTO  getLastTimeByDeptIds(Long deptId);
    List<EmergencyExecuteDepLevelLasTimeRespDTO>  getLastTimeByDeptIds(Long deptId);
    /**
     * 根据部门id统计指定年份的应急演练数据
     * @param query
@@ -66,5 +67,8 @@
     */
    List<StatisticsDepLevelMonthEexcuteRespDTO> getCountByDeptIdsAndMonth(EmergencyDrillCountQuery query);
    EmergencyExecuteLastTimeRespDTO getLastPracticeTimeByDeptIdAndTime(EmergencyDrillTimeQuery query);
    List<EmergencyExecuteDepLevelLasTimeRespDTO> getLastPracticeTimeByDeptIdsAndTime(EmergencyDrillTimeQuery query);
}
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/EmergencyDrillExecuteInfoService.java
@@ -36,11 +36,13 @@
    String getLastTimeByDeptId(Long deptId);
    String getLastTimeByDeptIds(List<Long> deptIdList);
    List<EmergencyDrillExecuteLastTimeDO> getLastTimeByDeptIds(List<Long> deptIdList);
    List<EmergencyExecuteCountDO> getCountByDeptIdsAndTime(String startTime, String endTime, List<Long> deptId);
    EmergencyExecuteCountDO getCountByDeptIdAndMonth(Integer year,Integer month, Long deptId);
    List<EmergencyExecuteCountDO> getCountByDeptIdAndYear(Integer year, Long deptId);
    List<EmergencyDrillExecuteLastTimeDO> getLastTimeByDeptIdsAndTime(List<Long> deptIdList,String startTime,String endTime);
    String getLastTimeByDeptIdAndTime(Long deptId, String startTime, String endTime);
}
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/baseService/impl/EmergencyDrillExecuteInfoServiceImpl.java
@@ -89,12 +89,27 @@
    }
    @Override
    public String getLastTimeByDeptIds(List<Long> deptIdList) {
    public List<EmergencyDrillExecuteLastTimeDO> getLastTimeByDeptIds(List<Long> deptIdList) {
        if(null == deptIdList || deptIdList.size() == 0){
            throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PARAM_NULL);
        }
        return baseMapper.getLastTimeByDeptIds(deptIdList);
    }
    @Override
    public List<EmergencyDrillExecuteLastTimeDO> getLastTimeByDeptIdsAndTime(List<Long> deptIdList,String startTime,String endTime) {
        if(null == deptIdList || deptIdList.size() == 0 || StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime)){
            throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PARAM_NULL);
        }
        return baseMapper.getLastTimeByDeptIdsAndTime(deptIdList,startTime,endTime);
    }
    @Override
    public String getLastTimeByDeptIdAndTime(Long deptId, String startTime, String endTime) {
        if(null == deptId || StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime)){
            throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PARAM_NULL);
        }
        return baseMapper.getLastTimeByDeptIdAndTime(deptId,startTime,endTime);
    }
    @Override
    public List<EmergencyExecuteCountDO> getCountByDeptIdsAndTime(String startTime, String endTime, List<Long> deptIds) {
emergency/emergency-service/src/main/java/com/gkhy/safePlatform/emergency/service/impl/EmergencyCountServiceImpl.java
@@ -17,6 +17,7 @@
import com.gkhy.safePlatform.emergency.model.dto.resp.*;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillCountQuery;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillExecuteCountQuery;
import com.gkhy.safePlatform.emergency.query.EmergencyDrillTimeQuery;
import com.gkhy.safePlatform.emergency.query.EmergencySuppliesCountQuery;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteNumRPCReq;
import com.gkhy.safePlatform.emergency.rpc.api.model.dto.req.EmergencyExecuteTimeRPCReq;
@@ -32,6 +33,7 @@
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -371,7 +373,7 @@
     * 查询部门及其子级部门最后一次演练时间
     * 后面按部门等级划分
     */
    public EmergencyExecuteTimeRespDTO  getLastTimeByDeptIds(Long deptId){
    public List<EmergencyExecuteDepLevelLasTimeRespDTO>  getLastTimeByDeptIds(Long deptId){
        if(null == deptId){
            throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PARAM_NULL);
@@ -383,24 +385,144 @@
                .stream()
                .map(dep -> dep.getDepId())
                .collect(Collectors.toList());
        //过滤出传入部门的信息
        List<DepInfoRPCRespDTO> selectDepList = depInfoList
                .stream()
                .filter(dep -> dep.getDepId().equals(deptId))
                .collect(Collectors.toList());
        // 查询该部门ids最后一次演练时间
        String lastTime = emergencyDrillExecuteInfoService.getLastTimeByDeptIds(deptIdList);
        List<EmergencyDrillExecuteLastTimeDO> executeLastTimeDOS = emergencyDrillExecuteInfoService.getLastTimeByDeptIds(deptIdList);
        List<EmergencyExecuteDepLevelLasTimeRespDTO> depLevelRespDTOList = new ArrayList<>();
        //循环部门等级
        for(DepartmentLevelEnum departmentLevelEnum : DepartmentLevelEnum.values()){
            //数据填充
            EmergencyExecuteDepLevelLasTimeRespDTO depLevelRespDTO = new EmergencyExecuteDepLevelLasTimeRespDTO();
            depLevelRespDTO.setDepLevel(departmentLevelEnum.getCode());
        //填充数据
        EmergencyExecuteTimeRespDTO respDTO = new EmergencyExecuteTimeRespDTO();
        respDTO.setDepId(deptId);
        respDTO.setLastPricticeTime(StringUtils.isBlank(lastTime) == true ? "" : lastTime);
        if(selectDepList.size()>0){
            respDTO.setDepLevel(selectDepList.get(0).getDepLevel());
            //该等级下的部门数据
            List<DepInfoRPCRespDTO> selectDepList = depInfoList
                    .stream()
                    .filter(dep -> dep.getDepLevel().equals(departmentLevelEnum.getCode()))
                    .collect(Collectors.toList());
            //获取该部门等级下部门演练数据
            List<EmergencyDrillExecuteLastTimeDO> selectExeList = executeLastTimeDOS
                    .stream()
                    .filter(exe -> selectDepList.stream().map(dep -> dep.getDepId()).collect(Collectors.toList()).contains(exe.getDeptId()))
                    .collect(Collectors.toList());
            //获取该等级最后一次演练时间
            String lastTime = getLastPracticeTime(selectExeList);
            depLevelRespDTO.setLastPricateTime(lastTime);
            depLevelRespDTOList.add(depLevelRespDTO);
        }
        return depLevelRespDTOList;
    }
    //获取最大日期
    private String getLastPracticeTime(List<EmergencyDrillExecuteLastTimeDO> selectExeList){
        String lastTime = "";
        if(selectExeList.size()>0){
            SimpleDateFormat sdft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Collections.sort(selectExeList, new Comparator<EmergencyDrillExecuteLastTimeDO>(){
                @Override
                public int compare(EmergencyDrillExecuteLastTimeDO timeDO01, EmergencyDrillExecuteLastTimeDO timeDO02) {
                    int flag = -1;
                    try {
                        Date date1 = sdft.parse(timeDO01.getLastTime());
                        Date date2 = sdft.parse(timeDO02.getLastTime());
                        if(date1.before(date2)){
                            flag=1;
                        }
                    } catch (ParseException e) {
                        e.printStackTrace();
                    }
                    return flag;
                } //compare
            });
            EmergencyDrillExecuteLastTimeDO lastTimeDO = selectExeList.get(0);
            lastTime = lastTimeDO.getLastTime();
        }
        return lastTime;
    }
    @Override
    public EmergencyExecuteLastTimeRespDTO getLastPracticeTimeByDeptIdAndTime(EmergencyDrillTimeQuery query) {
        if(null == query.getDeptId()){
            throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PARAM_NULL,"部门id不可为空");
        }
        if(null == query.getYear()){
            throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PARAM_NULL,"年份不可为空");
        }
        //通过RPC获取部门相关数据
        DepInfoRPCRespDTO depInfoRPCRespDTO = getDepInfoByDepId(query.getDeptId());
        //开始时间结束时间
        String startTime;
        String endTime;
        if(null == query.getMonth()){//年
            startTime = TimeUtils.getYearFirst(query.getYear());
            endTime = TimeUtils.getYearLast(query.getYear());
        }else{//月
            startTime = TimeUtils.getMonthFirst(query.getYear(),query.getMonth());
            endTime = TimeUtils.getMonthLast(query.getYear(),query.getMonth());
        }
        // 查询该部门最后一次演练时间
        String lastTime = emergencyDrillExecuteInfoService.getLastTimeByDeptIdAndTime(query.getDeptId(), startTime,endTime);
        //填充数据
        EmergencyExecuteLastTimeRespDTO respDTO = new EmergencyExecuteLastTimeRespDTO();
        respDTO.setDepId(depInfoRPCRespDTO.getDepId());
        respDTO.setDepLevel(depInfoRPCRespDTO.getDepLevel());
        respDTO.setYear(query.getYear());
        respDTO.setMonth(query.getMonth());
        respDTO.setLastPricticeTime(StringUtils.isBlank(lastTime) == true ? "" : lastTime);
        return respDTO;
    }
    @Override
    public List<EmergencyExecuteDepLevelLasTimeRespDTO> getLastPracticeTimeByDeptIdsAndTime(EmergencyDrillTimeQuery query) {
        if(null == query.getDeptId()){
            throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PARAM_NULL,"部门id不可为空");
        }
        if(null == query.getYear()){
            throw new EmergencyException(EmergencyResultCodes.SUPPLIES_PARAM_NULL,"年份不可为空");
        }
        //通过RPC获取部门相关数据
        List<DepInfoRPCRespDTO> depInfoList = getDepListInfoByDepId(query.getDeptId());
        //过滤获取部门id
        List<Long> deptIdList = depInfoList
                .stream()
                .map(dep -> dep.getDepId())
                .collect(Collectors.toList());
        //开始时间结束时间
        String startTime;
        String endTime;
        if(null == query.getMonth()){//年
            startTime = TimeUtils.getYearFirst(query.getYear());
            endTime = TimeUtils.getYearLast(query.getYear());
        }else{//月
            startTime = TimeUtils.getMonthFirst(query.getYear(),query.getMonth());
            endTime = TimeUtils.getMonthLast(query.getYear(),query.getMonth());
        }
        // 查询该部门ids最后一次演练时间
        List<EmergencyDrillExecuteLastTimeDO> executeLastTimeDOS = emergencyDrillExecuteInfoService.getLastTimeByDeptIdsAndTime(deptIdList,startTime,endTime);
        List<EmergencyExecuteDepLevelLasTimeRespDTO> depLevelRespDTOList = new ArrayList<>();
        //循环部门等级
        for(DepartmentLevelEnum departmentLevelEnum : DepartmentLevelEnum.values()){
            //数据填充
            EmergencyExecuteDepLevelLasTimeRespDTO depLevelRespDTO = new EmergencyExecuteDepLevelLasTimeRespDTO();
            depLevelRespDTO.setDepLevel(departmentLevelEnum.getCode());
            depLevelRespDTO.setYear(query.getYear());
            depLevelRespDTO.setMonth(query.getMonth());
            //该等级下的部门数据
            List<DepInfoRPCRespDTO> selectDepList = depInfoList
                    .stream()
                    .filter(dep -> dep.getDepLevel().equals(departmentLevelEnum.getCode()))
                    .collect(Collectors.toList());
            //获取该部门等级下部门演练数据
            List<EmergencyDrillExecuteLastTimeDO> selectExeList = executeLastTimeDOS
                    .stream()
                    .filter(exe -> selectDepList.stream().map(dep -> dep.getDepId()).collect(Collectors.toList()).contains(exe.getDeptId()))
                    .collect(Collectors.toList());
            //获取该等级最后一次演练时间
            String lastTime = getLastPracticeTime(selectExeList);
            depLevelRespDTO.setLastPricateTime(lastTime);
            depLevelRespDTOList.add(depLevelRespDTO);
        }
        return depLevelRespDTOList;
    }
    /**
     * 根据部门id和指定年份 统计演练数据
     *
@@ -615,4 +737,6 @@
    }
}
emergency/emergency-service/src/main/resources/config/mapper/emergency/EmergencyDrillExecuteInfoMapper.xml
@@ -242,16 +242,19 @@
                AND a.del_flag = 0 AND b.department_id = #{deptId}
    </select>
    <!--根据部门及其子级获取-->
    <select id="getLastTimeByDeptIds" resultType="java.lang.String">
    <select id="getLastTimeByDeptIds" resultType="com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteLastTimeDO">
        SELECT
            DATE_FORMAT( max( a.gmt_create ), '%Y-%m-%d %H:%i:%s' ) AS lastTime
        DATE_FORMAT( max( a.gmt_create ), '%Y-%m-%d %H:%i:%s' ) AS lastTime,
        b.department_id AS deptId
        FROM
            `emergency_drill_execute` a
                INNER JOIN emergency_drill_plan b ON a.drill_plan_id = b.id
                AND a.del_flag = 0 AND b.department_id IN
        `emergency_drill_execute` a
        INNER JOIN emergency_drill_plan b ON a.drill_plan_id = b.id
        AND a.del_flag = 0 AND b.department_id IN
        <foreach collection="deptIdList" item="deptId" open="(" close=")" separator=",">
            #{deptId}
        </foreach>
        GROUP BY
        b.department_id
    </select>
    <select id="getCountByDeptIdsAndTime" resultType="com.gkhy.safePlatform.emergency.entity.EmergencyExecuteCountDO">
        SELECT
@@ -304,6 +307,32 @@
        DATE_FORMAT( a.gmt_create, '%Y-%m' ),
        DATE_FORMAT(a.gmt_create,'%m')
    </select>
    <select id="getLastTimeByDeptIdsAndTime" resultType="com.gkhy.safePlatform.emergency.entity.EmergencyDrillExecuteLastTimeDO">
        SELECT
        DATE_FORMAT( max( a.gmt_create ), '%Y-%m-%d %H:%i:%s' ) AS lastTime,
        b.department_id AS deptId
        FROM
        `emergency_drill_execute` a
        INNER JOIN emergency_drill_plan b ON a.drill_plan_id = b.id
        AND a.del_flag = 0
        AND DATE( a.gmt_create ) BETWEEN #{startTime}
        AND #{endTime}
        AND b.department_id IN
        <foreach collection="deptIdList" item="deptId" open="(" close=")" separator=",">
            #{deptId}
        </foreach>
        GROUP BY
        b.department_id
    </select>
    <select id="getLastTimeByDeptIdAndTime" resultType="java.lang.String">
        SELECT
        DATE_FORMAT( max( a.gmt_create ), '%Y-%m-%d %H:%i:%s' ) AS lastTime
        FROM
        `emergency_drill_execute` a
        INNER JOIN emergency_drill_plan b ON a.drill_plan_id = b.id
        AND a.del_flag = 0
        AND DATE( a.gmt_create ) BETWEEN #{startTime}
        AND #{endTime}
        AND b.department_id = #{deptId}
    </select>
</mapper>
equipment/equipment-rpc-api/pom.xml
@@ -9,7 +9,14 @@
    </parent>-->
    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>
    <dependencies>
        <dependency>
            <groupId>com.gkhy.safePlatfrom</groupId>
            <artifactId>commons</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
    <groupId>com.gkhy.safePlatfrom</groupId>
    <artifactId>equipment-rpc-api</artifactId>
    <version>1.0-SNAPSHOT</version>
@@ -72,6 +79,14 @@
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/EquipmentDemoRpcAPi.java
文件已删除
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/EquipmentRpcAPi.java
对比新文件
@@ -0,0 +1,54 @@
package com.gkhy.safePlatform.equipment.rpc.api;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.equipment.rpc.api.model.dto.req.MaterialReceiveRecordsRPCReq;
import com.gkhy.safePlatform.equipment.rpc.api.model.dto.req.MaterialSpwRPCReq;
import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.*;
import java.util.List;
public interface EquipmentRpcAPi {
    /**
     * 物资类型分类
     */
    ResultVO<List<SafeMaterialClassifyRPCRespDto>> getMaterialClassifyList();
    /**
     * 根据小类溯源到父类信息
     * @param smallClassifyIds
     * @return
     */
    ResultVO<List<SafeMaterialBsClassifyRPCRespDto>> getTraceabilityClassifyList(List<Long> smallClassifyIds);
    /**
     * 根据小类溯源到父类信息 列表
     * @param smallClassifyId
     * @return
     */
    ResultVO<SafeMaterialBsClassifyRPCRespDto> getBigAndSmallClassifyInfo(Long smallClassifyId);
    /**
     * 根据小类ids查询物资种类
     */
    ResultVO<List<SafeMaterialClassifyRPCRespDto>> getClassifyListByIds(List<Long> ids);
    /**
     * 根据物资种类(小类)获取其库存
     */
    ResultVO<List<SafeMaterialClassifyStockRPCRespDto>> getSmallClassifyStockByIds(List<Long> smallClassifyIds);
    /**
     * 特殊作业批量出库
     */
    ResultVO deliveryBatchSpw(MaterialSpwRPCReq req);
    /**
     * 根据rfids获取物资
     */
    ResultVO<List<SafeRfidMaterialDetailRPCRespDto>> getListByRfid(List<String> rfids);
    /**
     * 根据人员和小类获取领取记录
     */
    ResultVO<List<MaterialReceiveRecordsRPCRespDto>> getMaterialReceiveRecords(MaterialReceiveRecordsRPCReq req);
}
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/req/MaterialReceiveRecordsRPCReq.java
对比新文件
@@ -0,0 +1,25 @@
package com.gkhy.safePlatform.equipment.rpc.api.model.dto.req;
import java.util.List;
public class MaterialReceiveRecordsRPCReq {
    private List<Long> receiveUids;
    private List<Long> smallClassifyIds;
    public List<Long> getReceiveUids() {
        return receiveUids;
    }
    public void setReceiveUids(List<Long> receiveUids) {
        this.receiveUids = receiveUids;
    }
    public List<Long> getSmallClassifyIds() {
        return smallClassifyIds;
    }
    public void setSmallClassifyIds(List<Long> smallClassifyIds) {
        this.smallClassifyIds = smallClassifyIds;
    }
}
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/req/MaterialSpwDeliveryRPCReq.java
对比新文件
@@ -0,0 +1,35 @@
package com.gkhy.safePlatform.equipment.rpc.api.model.dto.req;
public class MaterialSpwDeliveryRPCReq {
    private Integer count;
    private Long smallClassifyId;
    private Long depId;
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
}
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/req/MaterialSpwRPCReq.java
对比新文件
@@ -0,0 +1,27 @@
package com.gkhy.safePlatform.equipment.rpc.api.model.dto.req;
import java.util.List;
public class MaterialSpwRPCReq {
    private Long claimantId;
    private List<MaterialSpwDeliveryRPCReq> deliveryReqList;
    public Long getClaimantId() {
        return claimantId;
    }
    public void setClaimantId(Long claimantId) {
        this.claimantId = claimantId;
    }
    public List<MaterialSpwDeliveryRPCReq> getDeliveryReqList() {
        return deliveryReqList;
    }
    public void setDeliveryReqList(List<MaterialSpwDeliveryRPCReq> deliveryReqList) {
        this.deliveryReqList = deliveryReqList;
    }
}
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/MaterialReceiveRecordsRPCRespDto.java
对比新文件
@@ -0,0 +1,213 @@
package com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
public class MaterialReceiveRecordsRPCRespDto {
    /**
     * id
     */
    private Long id;
    /**
     * 物资名称
     */
    private String materialName;
    /**
     * 物资编号
     */
    private String materialNo;
    /**
     * rfid
     */
    private String rfid;
    /**
     * 领取时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime receiveTime;
    /**
     * 领取人id
     */
    private Long receiveUid;
    /**
     * 领取人姓名
     */
    private String receiveUname;
    /**
     * 归还状态(0未归还,1归还,3损耗)
     */
    private Byte revertStatus;
    /**
     * 物资状态
     */
    private Byte materialStatus;
    /**
     * 备注
     */
    private String remark;
    /**
     * 归还时间
     */
    private LocalDateTime revertTime;
    /**
     * 物资清单(详细物资)id
     */
    private Long smdId;
    /**
     * 基础记录id
     */
    private Long receiveBaseId;
    private Byte validStatus;
    private Long smallClassifyId;
    private Byte consumable;
    private Long bigClassifyId;
    private String bigClassifyName;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public String getMaterialNo() {
        return materialNo;
    }
    public void setMaterialNo(String materialNo) {
        this.materialNo = materialNo;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public LocalDateTime getReceiveTime() {
        return receiveTime;
    }
    public void setReceiveTime(LocalDateTime receiveTime) {
        this.receiveTime = receiveTime;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Byte getRevertStatus() {
        return revertStatus;
    }
    public void setRevertStatus(Byte revertStatus) {
        this.revertStatus = revertStatus;
    }
    public Byte getMaterialStatus() {
        return materialStatus;
    }
    public void setMaterialStatus(Byte materialStatus) {
        this.materialStatus = materialStatus;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public LocalDateTime getRevertTime() {
        return revertTime;
    }
    public void setRevertTime(LocalDateTime revertTime) {
        this.revertTime = revertTime;
    }
    public Long getSmdId() {
        return smdId;
    }
    public void setSmdId(Long smdId) {
        this.smdId = smdId;
    }
    public Long getReceiveBaseId() {
        return receiveBaseId;
    }
    public void setReceiveBaseId(Long receiveBaseId) {
        this.receiveBaseId = receiveBaseId;
    }
    public Byte getValidStatus() {
        return validStatus;
    }
    public void setValidStatus(Byte validStatus) {
        this.validStatus = validStatus;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public String getBigClassifyName() {
        return bigClassifyName;
    }
    public void setBigClassifyName(String bigClassifyName) {
        this.bigClassifyName = bigClassifyName;
    }
}
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/SafeMaterialBsClassifyRPCRespDto.java
对比新文件
@@ -0,0 +1,40 @@
package com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp;
public class SafeMaterialBsClassifyRPCRespDto {
    private Long smallClassifyId;
    private String smallClassifyName;
    private Long bigClassifyId;
    private String bigClassifyName;
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public String getSmallClassifyName() {
        return smallClassifyName;
    }
    public void setSmallClassifyName(String smallClassifyName) {
        this.smallClassifyName = smallClassifyName;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public String getBigClassifyName() {
        return bigClassifyName;
    }
    public void setBigClassifyName(String bigClassifyName) {
        this.bigClassifyName = bigClassifyName;
    }
}
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/SafeMaterialClassifyRPCRespDto.java
对比新文件
@@ -0,0 +1,66 @@
package com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp;
import java.util.List;
public class SafeMaterialClassifyRPCRespDto {
    private Long id;
    private String materialClassifyName;
    private Long parentId;
    /**
     * 是否是耗材(0是,1否)
     */
    private Byte consumable;
    private String consumableName;
    private List<SafeMaterialClassifyRPCRespDto> childList;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialClassifyName() {
        return materialClassifyName;
    }
    public void setMaterialClassifyName(String materialClassifyName) {
        this.materialClassifyName = materialClassifyName;
    }
    public Long getParentId() {
        return parentId;
    }
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    public List<SafeMaterialClassifyRPCRespDto> getChildList() {
        return childList;
    }
    public void setChildList(List<SafeMaterialClassifyRPCRespDto> childList) {
        this.childList = childList;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
    public String getConsumableName() {
        return consumableName;
    }
    public void setConsumableName(String consumableName) {
        this.consumableName = consumableName;
    }
}
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/SafeMaterialClassifyStockRPCRespDto.java
对比新文件
@@ -0,0 +1,40 @@
package com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp;
public class SafeMaterialClassifyStockRPCRespDto {
    private Long smallClassifyId;
    private Long depId;
    private String depName;
    private Integer stockCount;
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public Integer getStockCount() {
        return stockCount;
    }
    public void setStockCount(Integer stockCount) {
        this.stockCount = stockCount;
    }
}
equipment/equipment-rpc-api/src/main/java/com/gkhy/safePlatform/equipment/rpc/api/model/dto/resp/SafeRfidMaterialDetailRPCRespDto.java
对比新文件
@@ -0,0 +1,52 @@
package com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp;
public class SafeRfidMaterialDetailRPCRespDto {
    private Long id;
    private String name;
    private Long bigClassifyId;
    private Long smallClassifyId;
    private Long depId;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
}
equipment/equipment-rpc-provider/src/main/java/com/gkhy/safePlatform/equipment/rpc/provider/EquipmentRpcProvider.java
对比新文件
@@ -0,0 +1,239 @@
package com.gkhy.safePlatform.equipment.rpc.provider;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.utils.BeanCopyUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsDO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialSpwDeliveryReq;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialSpwReq;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeRfidMaterialDetailDto;
import com.gkhy.safePlatform.equipment.rpc.api.EquipmentRpcAPi;
import com.gkhy.safePlatform.equipment.rpc.api.model.dto.req.MaterialReceiveRecordsRPCReq;
import com.gkhy.safePlatform.equipment.rpc.api.model.dto.req.MaterialSpwDeliveryRPCReq;
import com.gkhy.safePlatform.equipment.rpc.api.model.dto.req.MaterialSpwRPCReq;
import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.*;
import com.gkhy.safePlatform.equipment.service.MaterialClassifyService;
import com.gkhy.safePlatform.equipment.service.MaterialReceiveRecordsService;
import com.gkhy.safePlatform.equipment.service.SafeMaterialDetailService;
import com.gkhy.safePlatform.equipment.service.impl.MaterialReceiveRecordsServiceImpl;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@DubboService
public class EquipmentRpcProvider implements EquipmentRpcAPi {
    @Autowired
    private MaterialClassifyService materialClassifyService;
    @Autowired
    private SafeMaterialDetailService safeMaterialDetailService;
    @Autowired
    private MaterialReceiveRecordsService materialReceiveRecordsService;
    public ResultVO<List<SafeMaterialClassifyRPCRespDto>> getMaterialClassifyList(){
      ResultVO<List<SafeMaterialClassifyRPCRespDto>> resultVO = new ResultVO(ResultCodes.OK);
        List<SafeMaterialClassifyDto> list = materialClassifyService.list();
        List<SafeMaterialClassifyRPCRespDto> rpcRespList = new ArrayList<>();
        for (SafeMaterialClassifyDto classifyDto:list) {
            SafeMaterialClassifyRPCRespDto classifyRPCRespDto = new SafeMaterialClassifyRPCRespDto();
            classifyRPCRespDto.setId(classifyDto.getId());
            classifyRPCRespDto.setParentId(classifyDto.getParentId());
            classifyRPCRespDto.setMaterialClassifyName(classifyDto.getMaterialClassifyName());
            List<SafeMaterialClassifyDto> childList = classifyDto.getChildList();
            List<SafeMaterialClassifyRPCRespDto> childRPCList = new ArrayList<>();
            for(SafeMaterialClassifyDto child:childList){
                //临时限制一下
                if(child.getConsumable() == 1){
                    SafeMaterialClassifyRPCRespDto childRPCRespDto = new SafeMaterialClassifyRPCRespDto();
                    childRPCRespDto.setId(child.getId());
                    childRPCRespDto.setParentId(child.getParentId());
                    childRPCRespDto.setMaterialClassifyName(child.getMaterialClassifyName());
                    childRPCRespDto.setConsumable(child.getConsumable());
                    childRPCRespDto.setConsumableName(child.getConsumableName());
                    childRPCList.add(childRPCRespDto);
                }
            }
            classifyRPCRespDto.setChildList(childRPCList);
            rpcRespList.add(classifyRPCRespDto);
        }
       resultVO.setData(rpcRespList);
       return resultVO;
    }
    @Override
    public ResultVO<List<SafeMaterialBsClassifyRPCRespDto>> getTraceabilityClassifyList(List<Long> smallClassifyIds) {
        ResultVO<List<SafeMaterialBsClassifyRPCRespDto>> resultVO = new ResultVO<>(ResultCodes.OK);
        try {
            List<SafeMaterialClassifyDO> list = materialClassifyService.getTraceabilityClassifyList(smallClassifyIds);
            List<SafeMaterialBsClassifyRPCRespDto> classifyRPCRespDtoList= new ArrayList<>();
            for(SafeMaterialClassifyDO classifyDO:list){
                SafeMaterialBsClassifyRPCRespDto bsClassifyRPCRespDto = new SafeMaterialBsClassifyRPCRespDto();
                BeanUtils.copyProperties(classifyDO,bsClassifyRPCRespDto);
                classifyRPCRespDtoList.add(bsClassifyRPCRespDto);
            }
            resultVO.setData(classifyRPCRespDtoList);
        }catch (EquipmentException e){
            resultVO.setCode(e.getCode());
            resultVO.setMsg(e.getMessage());
        }catch (Exception e){
            resultVO.setCode(ResultCodes.SERVER_ERROR.getCode());
            resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc());
        }
        return resultVO;
    }
    public ResultVO<SafeMaterialBsClassifyRPCRespDto> getBigAndSmallClassifyInfo(Long smallClassifyId){
        ResultVO<SafeMaterialBsClassifyRPCRespDto> resultVO = new ResultVO<>(ResultCodes.OK);
        try {
            SafeMaterialClassifyDO safeMaterialClassifyDO = materialClassifyService.getBigAndSmallClassifyInfo(smallClassifyId);
            SafeMaterialBsClassifyRPCRespDto bsClassifyRPCRespDto = new SafeMaterialBsClassifyRPCRespDto();
            if(null != safeMaterialClassifyDO){
                BeanUtils.copyProperties(safeMaterialClassifyDO,bsClassifyRPCRespDto);
            }
            resultVO.setData(bsClassifyRPCRespDto);
        }catch (EquipmentException e){
            resultVO.setCode(e.getCode());
            resultVO.setMsg(e.getMessage());
        }catch (Exception e){
            resultVO.setCode(ResultCodes.SERVER_ERROR.getCode());
            resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc());
        }
        return resultVO;
    }
    @Override
    public ResultVO<List<SafeMaterialClassifyRPCRespDto>> getClassifyListByIds(List<Long> ids) {
        ResultVO<List<SafeMaterialClassifyRPCRespDto>> resultVO = new ResultVO<>(ResultCodes.OK);
        try {
            List<SafeMaterialClassifyDto> listBySmallClassify = materialClassifyService.getClassifyListByIds(ids);
            List<SafeMaterialClassifyRPCRespDto> classifyRPCRespDtoList = new ArrayList<>();
            for(SafeMaterialClassifyDto classifyDto:listBySmallClassify){
                SafeMaterialClassifyRPCRespDto classifyRPCRespDto = new SafeMaterialClassifyRPCRespDto();
                BeanUtils.copyProperties(classifyDto,classifyRPCRespDto);
                classifyRPCRespDtoList.add(classifyRPCRespDto);
            }
            resultVO.setData(classifyRPCRespDtoList);
        }catch (EquipmentException e){
            resultVO.setCode(e.getCode());
            resultVO.setMsg(e.getMessage());
        }catch (Exception e){
            resultVO.setCode(ResultCodes.SERVER_ERROR.getCode());
            resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc());
        }
        return resultVO;
    }
    @Override
    public ResultVO<List<SafeMaterialClassifyStockRPCRespDto>> getSmallClassifyStockByIds(List<Long> smallClassifyIds) {
        ResultVO<List<SafeMaterialClassifyStockRPCRespDto>> resultVO = new ResultVO<>(ResultCodes.OK);
        try {
            List<SafeMaterialClassifyStockDto> smallClassifyStockList  = safeMaterialDetailService.getSmallClassifyStockByIds(smallClassifyIds);
            List<SafeMaterialClassifyStockRPCRespDto> classifyRPCRespDtoList = new ArrayList<>();
            for(SafeMaterialClassifyStockDto classifyStockDto:smallClassifyStockList){
                SafeMaterialClassifyStockRPCRespDto classifyRPCRespDto = new SafeMaterialClassifyStockRPCRespDto();
                BeanUtils.copyProperties(classifyStockDto,classifyRPCRespDto);
                classifyRPCRespDtoList.add(classifyRPCRespDto);
            }
            resultVO.setData(classifyRPCRespDtoList);
        }catch (EquipmentException e){
            resultVO.setCode(e.getCode());
            resultVO.setMsg(e.getMessage());
        }catch (Exception e){
            resultVO.setCode(ResultCodes.SERVER_ERROR.getCode());
            resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc());
        }
        return resultVO;
    }
    @Override
    public ResultVO deliveryBatchSpw(MaterialSpwRPCReq req) {
        ResultVO resultVO = new ResultVO<>(ResultCodes.OK);
        MaterialSpwReq materialSpwReq = new MaterialSpwReq();
        List<MaterialSpwDeliveryReq> list = new ArrayList<>();
        List<MaterialSpwDeliveryRPCReq> deliveryRPCReqList = req.getDeliveryReqList();
        if(!CollectionUtils.isEmpty(deliveryRPCReqList)){
            for (MaterialSpwDeliveryRPCReq deliveryRPCReq:deliveryRPCReqList) {
                MaterialSpwDeliveryReq deliveryReq = new MaterialSpwDeliveryReq();
                BeanUtils.copyProperties(deliveryRPCReq,deliveryReq);
                list.add(deliveryReq);
            }
        }
        materialSpwReq.setClaimantId(req.getClaimantId());
        materialSpwReq.setDeliveryReqList(list);
        try {
            safeMaterialDetailService.deliveryBatchSpw(materialSpwReq);
        }catch (EquipmentException e){
            resultVO.setCode(e.getCode());
            resultVO.setMsg(e.getMessage());
        }catch (Exception e){
            resultVO.setCode(ResultCodes.SERVER_ERROR.getCode());
            resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc());
        }
        return resultVO;
    }
    @Override
    public ResultVO<List<SafeRfidMaterialDetailRPCRespDto>> getListByRfid(List<String> rfids) {
        ResultVO resultVO = new ResultVO<>(ResultCodes.OK);
        try {
            List<SafeRfidMaterialDetailDto> listByRfids = safeMaterialDetailService.getListByRfids(rfids);
            if(listByRfids.size()>0){
                List<SafeRfidMaterialDetailRPCRespDto> safeRfidMaterialDetailRPCRespDtos = BeanCopyUtils.copyBeanList(listByRfids, SafeRfidMaterialDetailRPCRespDto.class);
                resultVO.setData(safeRfidMaterialDetailRPCRespDtos);
            }
        }catch (EquipmentException e){
            resultVO.setCode(e.getCode());
            resultVO.setMsg(e.getMessage());
        }catch (Exception e){
            resultVO.setCode(ResultCodes.SERVER_ERROR.getCode());
            resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc());
        }
        return resultVO;
    }
    @Override
    public ResultVO<List<MaterialReceiveRecordsRPCRespDto>> getMaterialReceiveRecords(MaterialReceiveRecordsRPCReq req) {
        ResultVO resultVO = new ResultVO<>(ResultCodes.OK);
        MaterialReceiveRecordsBO  materialReceiveRecordsBO = new MaterialReceiveRecordsBO();
        if(null != req){
            BeanUtils.copyProperties(req,materialReceiveRecordsBO);
        }
        try {
            List<MaterialReceiveRecordsDO> list = materialReceiveRecordsService.getReceiveRecordsByReceiveUids(materialReceiveRecordsBO);
            List<MaterialReceiveRecordsRPCRespDto> materialReceiveRecordsRPCRespDtos = new ArrayList<>();
            if(list.size()>0){
                for(MaterialReceiveRecordsDO recordsDO:list){
                    MaterialReceiveRecordsRPCRespDto receiveRecordsRPCRespDto = new MaterialReceiveRecordsRPCRespDto();
                    BeanUtils.copyProperties(recordsDO,receiveRecordsRPCRespDto);
                    materialReceiveRecordsRPCRespDtos.add(receiveRecordsRPCRespDto);
                }
                resultVO.setData(materialReceiveRecordsRPCRespDtos);
            }
        }catch (EquipmentException e){
            resultVO.setCode(e.getCode());
            resultVO.setMsg(e.getMessage());
        }catch (Exception e){
            resultVO.setCode(ResultCodes.SERVER_ERROR.getCode());
            resultVO.setCode(ResultCodes.SERVER_ERROR.getDesc());
        }
        return resultVO;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/common/RocketMQTemplateHelper.java
对比新文件
@@ -0,0 +1,52 @@
package com.gkhy.safePlatform.equipment.common;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.SendStatus;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import java.util.Date;
@Component
public class RocketMQTemplateHelper {
    @Autowired
    private RocketMQTemplate rocketMQTemplate;
    private Logger logger = LoggerFactory.getLogger(this.getClass());
    /**
     * 事务提交后发送MQ
     * @param message
     * @param <T>
     */
    public <T> void syncSend(String destination, T message) {
        // 是否开启事务判断
        if (TransactionSynchronizationManager.isSynchronizationActive()) {
            TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
                @Override
                public void afterCommit() {
                    SendResult sendResult = rocketMQTemplate.syncSend(destination, message);
                    if(sendResult.getSendStatus() != SendStatus.SEND_OK){
                        logger.info("【安全物资和设备管理】事务提交后才发送MQ的消息发送失败!"+ new Date());
                    }else{
                        logger.info("【安全物资和设备管理】消息申请发送rocketMQ消息成功!"+ new Date());
                    }
                }
            });
        } else {
            SendResult sendResult = rocketMQTemplate.syncSend(destination, message);
            if(sendResult.getSendStatus() != SendStatus.SEND_OK){
                logger.info("【安全物资和设备管理】事务提交后才发送MQ的消息发送失败!"+ new Date());
            }else{
                logger.info("【安全物资和设备管理】消息申请发送rocketMQ消息成功!"+ new Date());
            }
        }
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/MaterialClassifyController.java
对比新文件
@@ -0,0 +1,99 @@
package com.gkhy.safePlatform.equipment.controller;
import com.alibaba.fastjson.JSONObject;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.utils.PageUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.model.dto.req.*;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyDto;
import com.gkhy.safePlatform.equipment.service.MaterialClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/equipment/classify")
public class MaterialClassifyController {
    @Autowired
    private MaterialClassifyService materialClassifyService;
    /**
     * 列表
     * @return
     */
    @PostMapping(value = "/list")
    public ResultVO<List<SafeMaterialClassifyDto>> list(Authentication authentication){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return new ResultVO<>(ResultCodes.OK,materialClassifyService.list());
    }
    /**
     * 列表
     * @return
     */
    @PostMapping(value = "page/list")
    public SearchResultVO<List<SafeMaterialClassifyDto>> listByPage(Authentication authentication,@RequestBody PageQuery<MaterialClassifyQuery> pageQuery){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        PageUtils.checkCheck(pageQuery);
        return materialClassifyService.listByPage(currentUser,pageQuery);
    }
    /**
     * 新增
     * @return
     */
    @PostMapping(value = "save")
    public ResultVO save(Authentication authentication, @Validated @RequestBody SafeMaterialClassifyAddReq req){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return materialClassifyService.save(currentUser,req);
    }
    /**
     * 更新
     * @return
     */
    @PostMapping(value = "update")
    public ResultVO update(Authentication authentication, @Validated @RequestBody SafeMaterialClassifyModReq req){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return materialClassifyService.update(currentUser,req);
    }
    /**
     * 逻辑删除 单条
     * @return
     */
    @PostMapping(value = "delete")
    public ResultVO delete(Authentication authentication, @RequestBody JSONObject jsonObject){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        Long id = jsonObject.getLong("id");
        return materialClassifyService.delete(currentUser,id);
    }
    /**
     * 逻辑删除-批量
     * @return
     */
//    @PostMapping(value = "batch/delete")
//    public ResultVO batchDelete(Authentication authentication, @Validated @RequestBody ParamForm paramForm){
//        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
//        return materialClassifyService.batchDelete(currentUser,paramForm);
//    }
    /**
     * 查询单条数据
     */
    @PostMapping(value = "queryById")
    public ResultVO<SafeMaterialClassifyDto> queryById(Authentication authentication, @RequestBody JSONObject jsonObject){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        Long id = jsonObject.getLong("id");
        return new ResultVO<>(ResultCodes.OK,materialClassifyService.queryById(currentUser,id));
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialController.java
对比新文件
@@ -0,0 +1,73 @@
package com.gkhy.safePlatform.equipment.controller;
import com.alibaba.fastjson.JSONObject;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.utils.PageUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.equipment.model.dto.req.ParamForm;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialAddReq;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialModReq;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialQuery;
import com.gkhy.safePlatform.equipment.service.SafeMaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.validation.annotation.Validated;
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;
@RestController
@RequestMapping(value = "/equipment/safeMaterial")
public class SafeMaterialController {
    @Autowired
    private SafeMaterialService safeMaterialService;
    @PostMapping(value = "save")
    public ResultVO save(Authentication authentication, @Validated @RequestBody SafeMaterialAddReq req){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialService.save(currentUser,req);
    }
    @PostMapping(value = "update")
    public ResultVO update(Authentication authentication, @Validated @RequestBody SafeMaterialModReq req){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialService.update(currentUser,req);
    }
    @PostMapping(value = "delete")
    public ResultVO delete(Authentication authentication, @RequestBody JSONObject jsonObject){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        Long id = jsonObject.getLong("id");
        return safeMaterialService.delete(currentUser,id);
    }
    @PostMapping(value = "queryById")
    public ResultVO queryById(Authentication authentication, @RequestBody JSONObject jsonObject){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        Long id = jsonObject.getLong("id");
        return safeMaterialService.queryById(currentUser,id);
    }
    @PostMapping(value = "list")
    public ResultVO list(Authentication authentication){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return new ResultVO<>(ResultCodes.OK,safeMaterialService.list(currentUser));
    }
    @PostMapping(value = "listByDepId")
    public ResultVO listByDepId(Authentication authentication){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return new ResultVO<>(ResultCodes.OK,safeMaterialService.listByDepId(currentUser));
    }
    @PostMapping(value = "page/list")
    public ResultVO listByPage(Authentication authentication,@RequestBody PageQuery<SafeMaterialQuery> pageQuery){
        PageUtils.checkCheck(pageQuery);
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialService.listByPage(currentUser,pageQuery);
    }
    @PostMapping(value = "deleteBatch")
    public ResultVO deleteBatch(Authentication authentication,@Validated @RequestBody ParamForm paramForm){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialService.deleteBatch(currentUser,paramForm);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialDetailController.java
对比新文件
@@ -0,0 +1,170 @@
package com.gkhy.safePlatform.equipment.controller;
import com.alibaba.fastjson.JSONObject;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.model.dto.req.*;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialDetailDto;
import com.gkhy.safePlatform.equipment.service.SafeMaterialDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping(value = "/equipment/smDetail")
public class SafeMaterialDetailController {
    @Autowired
    private SafeMaterialDetailService safeMaterialDetailService;
    /**
     * 新增入库
     * @param authentication
     * @return
     */
    @PostMapping(value = "/save")
    public ResultVO save(Authentication authentication,@Validated @RequestBody SafeMaterialDetailAddReq req){
        return safeMaterialDetailService.save(req);
    }
    /**
     * 批量入库
     */
    @PostMapping(value = "/saveBatch")
    public ResultVO saveBatch(Authentication authentication,@Validated @RequestBody SafeMaterialDetailAddReq req){
        return safeMaterialDetailService.saveBatch(req);
    }
    /**
     * 编辑
     */
    @PostMapping(value = "/update")
    public ResultVO update(Authentication authentication,@Validated @RequestBody SafeMaterialDetailReq req){
        return safeMaterialDetailService.update(req);
    }
    /**
     * 单独出库
     * @param authentication
     * @return
     */
    @PostMapping(value = "/single/delivery")
    public ResultVO singleDelivery(Authentication authentication, @Validated @RequestBody SafeMaterialDetailReq req){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        safeMaterialDetailService.singleDelivery(currentUser,req);
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 单独入库
     * @param authentication
     * @return
     */
    @PostMapping(value = "/single/receipt")
    public ResultVO singleReceipt(Authentication authentication,@RequestBody JSONObject jsonObject){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        Long id = jsonObject.getLong("id");
        safeMaterialDetailService.singleReceipt(id,currentUser);
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 批量出库 - 根据ids
     * @param authentication
     * @return
     */
    @PostMapping(value = "/batch/delivery/ids")
    public ResultVO deliveryBatchByIds(Authentication authentication, @Validated @RequestBody MterialDeliveryReq req){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        safeMaterialDetailService.deliveryBatchByIds(req,currentUser);
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 批量出库
     * @param authentication
     * @return
     */
    @PostMapping(value = "/batch/delivery/random")
    public ResultVO deliveryBatchRandom(Authentication authentication,@Validated @RequestBody MterialRandomDeliveryReq req){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        safeMaterialDetailService.deliveryBatchBySmId(req,currentUser);
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 批量重新入库
     */
    @PostMapping(value = "/batch/receipt")
    public ResultVO receiptBatch(Authentication authentication ,@Validated @RequestBody ParamForm paramForm){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialDetailService.receiptBatch(paramForm);
    }
    /**
     * 删除-单条
     * @param authentication
     * @return
     */
    @PostMapping(value = "/delete")
    public ResultVO delete(Authentication authentication, @RequestBody JSONObject jsonObject){
        Long id = jsonObject.getLong("id");
        return safeMaterialDetailService.delete(id);
    }
    /**
     * 批量删除
     * @param authentication
     * @return
     */
    @PostMapping(value = "/deleteBatch")
    public ResultVO deleteBatch(Authentication authentication,@Validated @RequestBody ParamForm paramForm){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialDetailService.deleteBatch(currentUser,paramForm);
    }
    /**
     * 分页查询
     * @param authentication
     * @return
     */
    @PostMapping(value = "/page/list")
    public SearchResultVO<List<SafeMaterialDetailDto>> listByPage(Authentication authentication, @RequestBody PageQuery<SafeMatetrialDetailQuery> pageQuery){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialDetailService.listByPage(currentUser,pageQuery);
    }
    /**
     * 查询单条数据
     * @param authentication
     * @return
     */
    @PostMapping(value = "/queryById")
    public ResultVO queryById(Authentication authentication,@RequestBody JSONObject jsonObject){
        Long id = jsonObject.getLong("id");
        return safeMaterialDetailService.queryById(id);
    }
    /**
     * 特殊作业批量出库接口
     * @param authentication
     * @return
     */
    @PostMapping(value = "/deliveryBatchSpw")
    public ResultVO deliveryBatchSpw(Authentication authentication, @Validated @RequestBody MaterialSpwReq req){
        safeMaterialDetailService.deliveryBatchSpw(req);
        return new ResultVO<>(ResultCodes.OK);
    }
 /**
     * 根据rfid获去数据
     * @param authentication
     * @return
     *//*
    @PostMapping(value = "/rfid/list")
    public ResultVO getListByRfid(Authentication authentication, @RequestBody String[] rfids){
        return new ResultVO(ResultCodes.OK,safeMaterialDetailService.getListByRfids(rfids));
    }*/
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialReceiveRecordsController.java
对比新文件
@@ -0,0 +1,46 @@
package com.gkhy.safePlatform.equipment.controller;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.utils.PageUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseDO;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsBaseReq;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsQuery;
import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialReceiveRecordsBaseDto;
import com.gkhy.safePlatform.equipment.service.MaterialReceiveRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/equipment/material/record")
public class SafeMaterialReceiveRecordsController {
    @Autowired
    private MaterialReceiveRecordsService materialReceiveRecordsService;
    @RequestMapping("page/list")
    public SearchResultVO<List<MaterialReceiveRecordsBaseDto>> list(Authentication authentication, @RequestBody PageQuery<MaterialReceiveRecordsQuery> pageQuery){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        PageUtils.checkCheck(pageQuery);
        return materialReceiveRecordsService.listByPage(currentUser,pageQuery);
    }
    /**
     * 归还物资
     */
    @RequestMapping("revert")
    public ResultVO revertMaterial(Authentication authentication, @Validated @RequestBody MaterialReceiveRecordsBaseReq req){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        materialReceiveRecordsService.revertMaterial(currentUser,req);
        return new ResultVO(ResultCodes.OK);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialDeliveryRecordDO.java
对比新文件
@@ -0,0 +1,153 @@
package com.gkhy.safePlatform.equipment.entity;
import java.time.LocalDateTime;
/**
 * 出库记录
 */
public class MaterialDeliveryRecordDO {
    /**
     * 主键
     */
    private Long receiveBaseId;
    /**
     * 物资名称
     */
    private String materialName;
    /**
     * RFID
     */
    private String rfid;
    /**
     * 状态
     */
    private Byte status;
    /**
     * 安全物资详表id
     */
    private Long smdId;
    /**
     * 认领人id
     */
    private Long receiveUid;
    /**
     * 认领人姓名
     */
    private String receiveUname;
    /**
     * 归还时间
     */
    private LocalDateTime revertTime;
    private Long receiveId;
    /**
     * 领取数量
     */
    private Integer receiveCount;
    /**
     * 归还数量
     */
    private Integer revertCount;
    /**
     * 物资归还
     */
    private Byte revertStatus;
    public Long getReceiveBaseId() {
        return receiveBaseId;
    }
    public void setReceiveBaseId(Long receiveBaseId) {
        this.receiveBaseId = receiveBaseId;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public Byte getStatus() {
        return status;
    }
    public void setStatus(Byte status) {
        this.status = status;
    }
    public Long getSmdId() {
        return smdId;
    }
    public void setSmdId(Long smdId) {
        this.smdId = smdId;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public LocalDateTime getRevertTime() {
        return revertTime;
    }
    public void setRevertTime(LocalDateTime revertTime) {
        this.revertTime = revertTime;
    }
    public Long getReceiveId() {
        return receiveId;
    }
    public void setReceiveId(Long receiveId) {
        this.receiveId = receiveId;
    }
    public Integer getReceiveCount() {
        return receiveCount;
    }
    public void setReceiveCount(Integer receiveCount) {
        this.receiveCount = receiveCount;
    }
    public Integer getRevertCount() {
        return revertCount;
    }
    public void setRevertCount(Integer revertCount) {
        this.revertCount = revertCount;
    }
    public Byte getRevertStatus() {
        return revertStatus;
    }
    public void setRevertStatus(Byte revertStatus) {
        this.revertStatus = revertStatus;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsBO.java
对比新文件
@@ -0,0 +1,25 @@
package com.gkhy.safePlatform.equipment.entity;
import java.util.List;
public class MaterialReceiveRecordsBO {
    private List<Long> receiveUids;
    private List<Long> smallClassifyIds ;
    public List<Long> getReceiveUids() {
        return receiveUids;
    }
    public void setReceiveUids(List<Long> receiveUids) {
        this.receiveUids = receiveUids;
    }
    public List<Long> getSmallClassifyIds() {
        return smallClassifyIds;
    }
    public void setSmallClassifyIds(List<Long> smallClassifyIds) {
        this.smallClassifyIds = smallClassifyIds;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsBaseBO.java
对比新文件
@@ -0,0 +1,32 @@
package com.gkhy.safePlatform.equipment.entity;
public class MaterialReceiveRecordsBaseBO {
    private Long id;
    private Byte status;
    private Integer revertCount;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Byte getStatus() {
        return status;
    }
    public void setStatus(Byte status) {
        this.status = status;
    }
    public Integer getRevertCount() {
        return revertCount;
    }
    public void setRevertCount(Integer revertCount) {
        this.revertCount = revertCount;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsBaseDO.java
对比新文件
@@ -0,0 +1,153 @@
package com.gkhy.safePlatform.equipment.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
public class MaterialReceiveRecordsBaseDO {
    /**
     * 主键
     */
    private Long id;
    /**
     * 物资种类名称
     */
    private String materialName;
    /**
     * 领取人id
     */
    private Long receiveUid;
    /**
     * 领取人姓名
     */
    private String receiveUname;
    /**
     * 领取数量
     */
    private Integer receiveCount;
    /**
     * 归还数量
     */
    private Integer revertCount;
    private Integer consumeCount;
    /**
     * 归还情况(0未归还,1部分归还,2归还完成,3耗材无需归还)
     */
    private Byte status;
    /**
     * 物资管理id
     */
    private Long smId;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public LocalDateTime createTime;
    private Long depId;
    private String depName;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Integer getReceiveCount() {
        return receiveCount;
    }
    public void setReceiveCount(Integer receiveCount) {
        this.receiveCount = receiveCount;
    }
    public Integer getRevertCount() {
        return revertCount;
    }
    public void setRevertCount(Integer revertCount) {
        this.revertCount = revertCount;
    }
    public Byte getStatus() {
        return status;
    }
    public void setStatus(Byte status) {
        this.status = status;
    }
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public Integer getConsumeCount() {
        return consumeCount;
    }
    public void setConsumeCount(Integer consumeCount) {
        this.consumeCount = consumeCount;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsBaseInfo.java
对比新文件
@@ -0,0 +1,226 @@
package com.gkhy.safePlatform.equipment.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
@TableName("material_receive_records_base")
public class MaterialReceiveRecordsBaseInfo {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 物资种类名称
     */
    private String materialName;
    /**
     * 领取人id
     */
    private Long receiveUid;
    /**
     * 领取人姓名
     */
    private String receiveUname;
    /**
     * 领取数量
     */
    private Integer receiveCount;
    /**
     * 归还数量
     */
    private Integer revertCount;
    /**
     * 损耗数量
     */
    private Integer consumeCount;
    /**
     * 归还情况(0未归还,1部分归还,2归还完成,3耗材无需归还)
     */
    private Byte status;
    /**
     * 物资管理id
     */
    private Long smId;
    /**
     * 删除标识
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private int delFlag;
    /**
     * 创建人id
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private Long createUid;
    /**
     * 创建人姓名
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private String createUname;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public LocalDateTime createTime;
    /**
     * 修改人id
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private Long updateUid;
    /**
     * 修改人姓名
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private String updateUname;
    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public Long getReceiveUid(Long uid) {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public Integer getReceiveCount() {
        return receiveCount;
    }
    public void setReceiveCount(Integer receiveCount) {
        this.receiveCount = receiveCount;
    }
    public Integer getRevertCount() {
        return revertCount;
    }
    public void setRevertCount(Integer revertCount) {
        this.revertCount = revertCount;
    }
    public int getDelFlag() {
        return delFlag;
    }
    public void setDelFlag(int delFlag) {
        this.delFlag = delFlag;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public Long getCreateUid() {
        return createUid;
    }
    public void setCreateUid(Long createUid) {
        this.createUid = createUid;
    }
    public String getCreateUname() {
        return createUname;
    }
    public void setCreateUname(String createUname) {
        this.createUname = createUname;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public Long getUpdateUid() {
        return updateUid;
    }
    public void setUpdateUid(Long updateUid) {
        this.updateUid = updateUid;
    }
    public String getUpdateUname() {
        return updateUname;
    }
    public void setUpdateUname(String updateUname) {
        this.updateUname = updateUname;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Byte getStatus() {
        return status;
    }
    public void setStatus(Byte status) {
        this.status = status;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public Integer getConsumeCount() {
        return consumeCount;
    }
    public void setConsumeCount(Integer consumeCount) {
        this.consumeCount = consumeCount;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsDO.java
对比新文件
@@ -0,0 +1,207 @@
package com.gkhy.safePlatform.equipment.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
public class MaterialReceiveRecordsDO {
    /**
     * id
     */
    private Long id;
    /**
     * 物资名称
     */
    private String materialName;
    /**
     * 物资编号
     */
    private String materialNo;
    /**
     * rfid
     */
    private String rfid;
    /**
     * 领取时间
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime receiveTime;
    /**
     * 领取人id
     */
    private Long receiveUid;
    /**
     * 领取人姓名
     */
    private String receiveUname;
    /**
     * 归还状态(0未归还,1归还,3损耗)
     */
    private Byte revertStatus;
    /**
     * 物资状态
     */
    private Byte materialStatus;
    /**
     * 备注
     */
    private String remark;
    /**
     * 归还时间
     */
    private LocalDateTime revertTime;
    /**
     * 物资清单(详细物资)id
     */
    private Long smdId;
    /**
     * 基础记录id
     */
    private Long receiveBaseId;
    private Byte validStatus;
    private Long smallClassifyId;
    private Long bigClassifyId;
    private Byte consumable;
    public Long getReceiveBaseId() {
        return receiveBaseId;
    }
    public void setReceiveBaseId(Long receiveBaseId) {
        this.receiveBaseId = receiveBaseId;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public String getMaterialNo() {
        return materialNo;
    }
    public void setMaterialNo(String materialNo) {
        this.materialNo = materialNo;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public LocalDateTime getReceiveTime() {
        return receiveTime;
    }
    public void setReceiveTime(LocalDateTime receiveTime) {
        this.receiveTime = receiveTime;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Byte getRevertStatus() {
        return revertStatus;
    }
    public void setRevertStatus(Byte revertStatus) {
        this.revertStatus = revertStatus;
    }
    public Byte getMaterialStatus() {
        return materialStatus;
    }
    public void setMaterialStatus(Byte materialStatus) {
        this.materialStatus = materialStatus;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public LocalDateTime getRevertTime() {
        return revertTime;
    }
    public void setRevertTime(LocalDateTime revertTime) {
        this.revertTime = revertTime;
    }
    public Long getSmdId() {
        return smdId;
    }
    public void setSmdId(Long smdId) {
        this.smdId = smdId;
    }
    public Byte getValidStatus() {
        return validStatus;
    }
    public void setValidStatus(Byte validStatus) {
        this.validStatus = validStatus;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/MaterialReceiveRecordsInfo.java
对比新文件
@@ -0,0 +1,168 @@
package com.gkhy.safePlatform.equipment.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
@TableName("material_receive_records")
public class MaterialReceiveRecordsInfo {
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 物资名称
     */
    private String materialName;
    /**
     * 物资编号
     */
    private String materialNo;
    /**
     * rfid
     */
    private String rfid;
    /**
     * 领取时间
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime receiveTime;
    /**
     * 领取人id
     */
    private Long receiveUid;
    /**
     * 领取人姓名
     */
    private String receiveUname;
    /**
     * 归还状态(0未归还,1归还,3损耗)
     */
    private Byte revertStatus;
    /**
     * 物资状态
     */
    private Byte materialStatus;
    /**
     * 备注
     */
    private String remark;
    /**
     * 归还时间
     */
    private LocalDateTime revertTime;
    /**
     * 物资清单(详细物资)id
     */
    private Long smdId;
    /**
     * 基础记录id
     */
    private Long receiveBaseId;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public String getMaterialNo() {
        return materialNo;
    }
    public void setMaterialNo(String materialNo) {
        this.materialNo = materialNo;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public Long getSmdId() {
        return smdId;
    }
    public void setSmdId(Long smdId) {
        this.smdId = smdId;
    }
    public Long getReceiveBaseId() {
        return receiveBaseId;
    }
    public void setReceiveBaseId(Long receiveBaseId) {
        this.receiveBaseId = receiveBaseId;
    }
    public LocalDateTime getReceiveTime() {
        return receiveTime;
    }
    public void setReceiveTime(LocalDateTime receiveTime) {
        this.receiveTime = receiveTime;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Byte getRevertStatus() {
        return revertStatus;
    }
    public void setRevertStatus(Byte revertStatus) {
        this.revertStatus = revertStatus;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public LocalDateTime getRevertTime() {
        return revertTime;
    }
    public void setRevertTime(LocalDateTime revertTime) {
        this.revertTime = revertTime;
    }
    public Byte getMaterialStatus() {
        return materialStatus;
    }
    public void setMaterialStatus(Byte materialStatus) {
        this.materialStatus = materialStatus;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialBO.java
对比新文件
@@ -0,0 +1,32 @@
package com.gkhy.safePlatform.equipment.entity;
public class SafeMaterialBO {
    private Long id;
    private Integer totalCount;
    private Integer stockCount;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Integer getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }
    public Integer getStockCount() {
        return stockCount;
    }
    public void setStockCount(Integer stockCount) {
        this.stockCount = stockCount;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialBatchDeliveryBO.java
对比新文件
@@ -0,0 +1,66 @@
package com.gkhy.safePlatform.equipment.entity;
import java.time.LocalDateTime;
import java.util.List;
public class SafeMaterialBatchDeliveryBO {
    private List<Long> ids;
    private Integer count;
    private Byte irStatus;
    private Long receiveUid;
    private String receiveUname;
    private LocalDateTime deliveryTime;
    public List<Long> getIds() {
        return ids;
    }
    public void setIds(List<Long> ids) {
        this.ids = ids;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public Byte getIrStatus() {
        return irStatus;
    }
    public void setIrStatus(Byte irStatus) {
        this.irStatus = irStatus;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public LocalDateTime getDeliveryTime() {
        return deliveryTime;
    }
    public void setDeliveryTime(LocalDateTime deliveryTime) {
        this.deliveryTime = deliveryTime;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialClassifyDO.java
对比新文件
@@ -0,0 +1,40 @@
package com.gkhy.safePlatform.equipment.entity;
public class SafeMaterialClassifyDO {
    private Long smallClassifyId;
    private String smallClassifyName;
    private Long bigClassifyId;
    private String bigClassifyName;
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public String getSmallClassifyName() {
        return smallClassifyName;
    }
    public void setSmallClassifyName(String smallClassifyName) {
        this.smallClassifyName = smallClassifyName;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public String getBigClassifyName() {
        return bigClassifyName;
    }
    public void setBigClassifyName(String bigClassifyName) {
        this.bigClassifyName = bigClassifyName;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialClassifyInfo.java
对比新文件
@@ -0,0 +1,153 @@
package com.gkhy.safePlatform.equipment.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
@TableName("safe_material_classify")
public class SafeMaterialClassifyInfo implements Serializable {
    private static final long serialVersionUID = -6700804265510606854L;
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 物资分类名称
     */
    private String materialClassifyName;
    /**
     * 父级id
     */
    private Long parentId;
    private Byte consumable;
    /**
     * 删除标识
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private int delFlag;
    /**
     * 创建人id
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private Long createUid;
    /**
     * 创建人姓名
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private String createUname;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public LocalDateTime createTime;
    /**
     * 修改人id
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private Long updateUid;
    /**
     * 修改人姓名
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private String updateUname;
    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialClassifyName() {
        return materialClassifyName;
    }
    public void setMaterialClassifyName(String materialClassifyName) {
        this.materialClassifyName = materialClassifyName;
    }
    public int getDelFlag() {
        return delFlag;
    }
    public void setDelFlag(int delFlag) {
        this.delFlag = delFlag;
    }
    public Long getCreateUid() {
        return createUid;
    }
    public void setCreateUid(Long createUid) {
        this.createUid = createUid;
    }
    public String getCreateUname() {
        return createUname;
    }
    public void setCreateUname(String createUname) {
        this.createUname = createUname;
    }
    public Long getUpdateUid() {
        return updateUid;
    }
    public void setUpdateUid(Long updateUid) {
        this.updateUid = updateUid;
    }
    public String getUpdateUname() {
        return updateUname;
    }
    public void setUpdateUname(String updateUname) {
        this.updateUname = updateUname;
    }
    public Long getParentId() {
        return parentId;
    }
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialClassifyStockDO.java
对比新文件
@@ -0,0 +1,44 @@
package com.gkhy.safePlatform.equipment.entity;
public class SafeMaterialClassifyStockDO {
    private Long smallClassifyId;
    private Long depId;
    private String depName;
    private Integer stockCount;
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public Integer getStockCount() {
        return stockCount;
    }
    public void setStockCount(Integer stockCount) {
        this.stockCount = stockCount;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialCountDO.java
对比新文件
@@ -0,0 +1,22 @@
package com.gkhy.safePlatform.equipment.entity;
public class SafeMaterialCountDO {
    private Long id;
    private Integer count;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDO.java
对比新文件
@@ -0,0 +1,242 @@
package com.gkhy.safePlatform.equipment.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
public class SafeMaterialDO {
    /**
     * 主键
     */
    private Long id;
    /**
     * 物资序列号  (如果以后id使用雪花算法时候再启用该字段)
     */
    private String serialNum;
    /**
     * 物资类型id
     */
    private Long bigClassifyId;
    private String bigClassifyName;
    private Long smallClassifyId;
    private String smallClassifyName;
    /**
     * 部门id
     */
    private Long depId;
    /**
     * 部门名称
     */
    private String depName;
    /**
     * 物资名称
     */
    private String materialName;
    /**
     *
     */
    private Integer totalCount;
    private Integer stockCount;
    /**
     * 是否是耗材(0是, 1否)
     */
    private Byte consumable;
    /**
     * 删除标识
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private int delFlag;
    /**
     * 创建人id
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private Long createUid;
    /**
     * 创建人姓名
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private String createUname;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public LocalDateTime createTime;
    /**
     * 修改人id
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private Long updateUid;
    /**
     * 修改人姓名
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private String updateUname;
    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getSerialNum() {
        return serialNum;
    }
    public void setSerialNum(String serialNum) {
        this.serialNum = serialNum;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
    public int getDelFlag() {
        return delFlag;
    }
    public void setDelFlag(int delFlag) {
        this.delFlag = delFlag;
    }
    public Long getCreateUid() {
        return createUid;
    }
    public void setCreateUid(Long createUid) {
        this.createUid = createUid;
    }
    public String getCreateUname() {
        return createUname;
    }
    public void setCreateUname(String createUname) {
        this.createUname = createUname;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public Long getUpdateUid() {
        return updateUid;
    }
    public void setUpdateUid(Long updateUid) {
        this.updateUid = updateUid;
    }
    public String getUpdateUname() {
        return updateUname;
    }
    public void setUpdateUname(String updateUname) {
        this.updateUname = updateUname;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public String getBigClassifyName() {
        return bigClassifyName;
    }
    public void setBigClassifyName(String bigClassifyName) {
        this.bigClassifyName = bigClassifyName;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public String getSmallClassifyName() {
        return smallClassifyName;
    }
    public void setSmallClassifyName(String smallClassifyName) {
        this.smallClassifyName = smallClassifyName;
    }
    public Integer getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }
    public Integer getStockCount() {
        return stockCount;
    }
    public void setStockCount(Integer stockCount) {
        this.stockCount = stockCount;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDetailCountDO.java
对比新文件
@@ -0,0 +1,32 @@
package com.gkhy.safePlatform.equipment.entity;
public class SafeMaterialDetailCountDO {
    private Long smId;
    private Integer count;
    private Long smallClassifyId;
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDetailDO.java
对比新文件
@@ -0,0 +1,49 @@
package com.gkhy.safePlatform.equipment.entity;
public class SafeMaterialDetailDO {
    private Long id;
    private String rfid;
    private Long depId;
    private Long smallClassifyId;
    private Long bigClassifyId;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDetailInfo.java
对比新文件
@@ -0,0 +1,327 @@
package com.gkhy.safePlatform.equipment.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
@TableName("safe_material_detail")
public class SafeMaterialDetailInfo implements Serializable {
    private static final long serialVersionUID = -3779254000698221155L;
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 物资名称
     */
    private String name;
    /**
     * 物资编号
     */
    private String materialNo;
    /**
     * 物资类型id 大类
     */
    private Long bigClassifyId;
    /**
     * 物资类型id 小类
     */
    private Long smallClassifyId;
    /**
     * RFID
     */
    private String rfid;
    /**
     * 是否是耗材(0是, 1否)
     */
    private Byte consumable;
    /**
     * 保质期类型
     */
    private Byte validType;
    /**
     * 保质到期时间
     */
    private Date validTime;
    /**
     * 状态
     */
    private Byte validStatus;
    /**
     * 出入库状态
     */
    private Byte irStatus;
    /**
     *  入库时间
     */
    private LocalDateTime wareHousingTime;
    /**
     * 出库时间
     */
    private LocalDateTime deliveryTime;
    /**
     * 安全物资字表id
     */
    private Long smId;
    /**
     * 认领人id
     */
    private Long receiveUid;
    /**
     * 认领人姓名
     */
    private String receiveUname;
    /**
     * 无效原因
     */
    private Byte status;
    /**
     * 描述
     */
    private String remark;
    /**
     * 删除标识
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private int delFlag;
    /**
     * 创建人id
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private Long createUid;
    /**
     * 创建人姓名
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private String createUname;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public LocalDateTime createTime;
    /**
     * 修改人id
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private Long updateUid;
    /**
     * 修改人姓名
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private String updateUname;
    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getMaterialNo() {
        return materialNo;
    }
    public void setMaterialNo(String materialNo) {
        this.materialNo = materialNo;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
    public Byte getValidType() {
        return validType;
    }
    public void setValidType(Byte validType) {
        this.validType = validType;
    }
    public Date getValidTime() {
        return validTime;
    }
    public void setValidTime(Date validTime) {
        this.validTime = validTime;
    }
    public Byte getValidStatus() {
        return validStatus;
    }
    public void setValidStatus(Byte validStatus) {
        this.validStatus = validStatus;
    }
    public Byte getIrStatus() {
        return irStatus;
    }
    public void setIrStatus(Byte irStatus) {
        this.irStatus = irStatus;
    }
    public LocalDateTime getWareHousingTime() {
        return wareHousingTime;
    }
    public void setWareHousingTime(LocalDateTime wareHousingTime) {
        this.wareHousingTime = wareHousingTime;
    }
    public LocalDateTime getDeliveryTime() {
        return deliveryTime;
    }
    public void setDeliveryTime(LocalDateTime deliveryTime) {
        this.deliveryTime = deliveryTime;
    }
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public int getDelFlag() {
        return delFlag;
    }
    public void setDelFlag(int delFlag) {
        this.delFlag = delFlag;
    }
    public Long getCreateUid() {
        return createUid;
    }
    public void setCreateUid(Long createUid) {
        this.createUid = createUid;
    }
    public String getCreateUname() {
        return createUname;
    }
    public void setCreateUname(String createUname) {
        this.createUname = createUname;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public Long getUpdateUid() {
        return updateUid;
    }
    public void setUpdateUid(Long updateUid) {
        this.updateUid = updateUid;
    }
    public String getUpdateUname() {
        return updateUname;
    }
    public void setUpdateUname(String updateUname) {
        this.updateUname = updateUname;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Byte getStatus() {
        return status;
    }
    public void setStatus(Byte status) {
        this.status = status;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialDetailInfoDO.java
对比新文件
@@ -0,0 +1,261 @@
package com.gkhy.safePlatform.equipment.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.util.Date;
public class SafeMaterialDetailInfoDO {
    /**
     * 主键
     */
    private Long id;
    /**
     * 物资名称
     */
    private String name;
    /**
     * 物资编号
     */
    private String materialNo;
    private Long smallClassifyId;
    /**
     * 物资类型id
     */
    private Long bigClassifyId;
    /**
     * 物资类型名称
     */
    private String bigClassifyName;
    /**
     * RFID
     */
    private String rfid;
    /**
     * 是否是耗材(0是, 1否)
     */
    private Byte consumable;
    /**
     * 部门名称
     *
     */
    private String depName;
    /**
     * 部门id
     */
    private Long depId;
    /**
     * 保质期类型
     */
    private Byte validType;
    /**
     * 保质到期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date validTime;
    /**
     * 状态
     */
    private Byte validStatus;
    private Byte status;
    private String remark;
    /**
     * 出入库状态
     */
    private Byte irStatus;
    /**
     *  入库时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime wareHousingTime;
    /**
     * 出库时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime deliveryTime;
    /**
     * 安全物资字表id
     */
    private Long smId;
    /**
     * 认领人id
     */
    private Long receiveUid;
    /**
     * 认领人姓名
     */
    private String receiveUname;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getMaterialNo() {
        return materialNo;
    }
    public void setMaterialNo(String materialNo) {
        this.materialNo = materialNo;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public String getBigClassifyName() {
        return bigClassifyName;
    }
    public void setBigClassifyName(String bigClassifyName) {
        this.bigClassifyName = bigClassifyName;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public Byte getValidType() {
        return validType;
    }
    public void setValidType(Byte validType) {
        this.validType = validType;
    }
    public Date getValidTime() {
        return validTime;
    }
    public void setValidTime(Date validTime) {
        this.validTime = validTime;
    }
    public Byte getValidStatus() {
        return validStatus;
    }
    public void setValidStatus(Byte validStatus) {
        this.validStatus = validStatus;
    }
    public Byte getIrStatus() {
        return irStatus;
    }
    public void setIrStatus(Byte irStatus) {
        this.irStatus = irStatus;
    }
    public LocalDateTime getWareHousingTime() {
        return wareHousingTime;
    }
    public void setWareHousingTime(LocalDateTime wareHousingTime) {
        this.wareHousingTime = wareHousingTime;
    }
    public LocalDateTime getDeliveryTime() {
        return deliveryTime;
    }
    public void setDeliveryTime(LocalDateTime deliveryTime) {
        this.deliveryTime = deliveryTime;
    }
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Byte getStatus() {
        return status;
    }
    public void setStatus(Byte status) {
        this.status = status;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/entity/SafeMaterialInfo.java
对比新文件
@@ -0,0 +1,228 @@
package com.gkhy.safePlatform.equipment.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.time.LocalDateTime;
@TableName("safe_material")
public class SafeMaterialInfo implements Serializable {
    private static final long serialVersionUID = -3147326241995464433L;
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 物资序列号  (如果以后id使用雪花算法时候再启用该字段)
     */
    private String serialNum;
    /**
     * 物资类型id 大类
     */
    private Long bigClassifyId;
    /**
     * 物资类型 小类
     */
    private Long smallClassifyId;
    /**
     * 部门id
     */
    private Long depId;
    /**
     * 部门名称
     */
    private String depName;
    /**
     * 物资名称
     */
    private String materialName;
    /**
     * 是否是耗材(0是, 1否)
     */
    private Byte consumable;
    /**
     * 有效数量
     */
    private Integer totalCount;
    /**
     * 库存数量
     */
    private Integer stockCount;
    /**
     * 删除标识
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private int delFlag;
    /**
     * 创建人id
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private Long createUid;
    /**
     * 创建人姓名
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    private String createUname;
    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public LocalDateTime createTime;
    /**
     * 修改人id
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private Long updateUid;
    /**
     * 修改人姓名
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    private String updateUname;
    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE) //自动填充的注解
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getSerialNum() {
        return serialNum;
    }
    public void setSerialNum(String serialNum) {
        this.serialNum = serialNum;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
    public int getDelFlag() {
        return delFlag;
    }
    public void setDelFlag(int delFlag) {
        this.delFlag = delFlag;
    }
    public Long getCreateUid() {
        return createUid;
    }
    public void setCreateUid(Long createUid) {
        this.createUid = createUid;
    }
    public String getCreateUname() {
        return createUname;
    }
    public void setCreateUname(String createUname) {
        this.createUname = createUname;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public Long getUpdateUid() {
        return updateUid;
    }
    public void setUpdateUid(Long updateUid) {
        this.updateUid = updateUid;
    }
    public String getUpdateUname() {
        return updateUname;
    }
    public void setUpdateUname(String updateUname) {
        this.updateUname = updateUname;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }
    public Integer getStockCount() {
        return stockCount;
    }
    public void setStockCount(Integer stockCount) {
        this.stockCount = stockCount;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/ConsumableEnum.java
对比新文件
@@ -0,0 +1,46 @@
package com.gkhy.safePlatform.equipment.enums;
import java.util.HashMap;
import java.util.Map;
public enum ConsumableEnum {
    YES((byte) 0, "耗材"),
    NO((byte) 1, "非耗材");
    private Byte code;
    private String value;
    ConsumableEnum(Byte code, String value) {
        this.code = code;
        this.value = value;
    }
    public Byte getCode() {
        return code;
    }
    public void setCode(Byte code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    // 转换成为 MAP<Byte, String>, 对外提供查询和遍历功能
    public static Map<Byte, ConsumableEnum> toMap() {
        Map<Byte, ConsumableEnum> map = new HashMap();
        for (ConsumableEnum consumableEnum : ConsumableEnum.values()) {
            map.put(consumableEnum.getCode(), consumableEnum);
        }
        return map;
    }
    public static ConsumableEnum getByCode(Byte code){
        return toMap().get(code);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/EquipmentResultCodes.java
@@ -10,6 +10,15 @@
    KEYPOINT_EQUIPMENT_ENUM_PART_TYPE_NOT_EXIST("K1001","重点设备装置部位分类类型异常"),
    DATA_HAS_BEEN_BOND("E1004","数据已被绑定"),
    DATA_NOT_EXIST("E1005","数据不存在"),
    MATERIAL_INVALID("E1006","物资无效"),
    MATERIAL_OUT_OF_LIBRARY("E1007","物资已出库,不可再次出库"),
    MATERIAL_IN_THE_LIBRARY("E1008","物资已入库,不可再次入库"),
    MATERIAL_CONSUMABLE("E1009","耗材物资不可重新入库"),
    DATA_EXIST("E1010","数据已存在"),
    DATA_ILLEGAL("E1011","数据不合法"),
    ERROR("A3000", "未知错误");
    private String code;
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/IssueReceiptEnum.java
对比新文件
@@ -0,0 +1,45 @@
package com.gkhy.safePlatform.equipment.enums;
import java.util.HashMap;
import java.util.Map;
public enum IssueReceiptEnum {
    IN_THE_LIBRARY((byte) 0, "在库"),
    OUT_OF_LIBRARY((byte) 1, "已出库");
    private Byte code;
    private String value;
    IssueReceiptEnum(Byte code, String value) {
        this.code = code;
        this.value = value;
    }
    public Byte getCode() {
        return code;
    }
    public void setCode(Byte code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    // 转换成为 MAP<Byte, String>, 对外提供查询和遍历功能
    public static Map<Byte, IssueReceiptEnum> toMap() {
        Map<Byte, IssueReceiptEnum> map = new HashMap();
        for (IssueReceiptEnum consumableEnum : IssueReceiptEnum.values()) {
            map.put(consumableEnum.getCode(), consumableEnum);
        }
        return map;
    }
    public static IssueReceiptEnum getByCode(Byte code){
        return toMap().get(code);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/MaterialReceiveRecordsStatusEnum.java
对比新文件
@@ -0,0 +1,49 @@
package com.gkhy.safePlatform.equipment.enums;
import java.util.HashMap;
import java.util.Map;
public enum MaterialReceiveRecordsStatusEnum {
    RETURN_NO((byte) 0, "未归还"),
    RETURN_PART((byte) 1, "部分归还"),
    RETURN_COMPLETE((byte)2,"归还完成"),
    CONSUMABLE_RETURN_NO((byte)3,"--");
    private Byte code;
    private String value;
    MaterialReceiveRecordsStatusEnum(Byte code, String value) {
        this.code = code;
        this.value = value;
    }
    public Byte getCode() {
        return code;
    }
    public void setCode(Byte code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    // 转换成为 MAP<Byte, String>, 对外提供查询和遍历功能
    public static Map<Byte, MaterialReceiveRecordsStatusEnum> toMap() {
        Map<Byte, MaterialReceiveRecordsStatusEnum> map = new HashMap();
        for (MaterialReceiveRecordsStatusEnum receiveRecordsStatusEnum : MaterialReceiveRecordsStatusEnum.values()) {
            map.put(receiveRecordsStatusEnum.getCode(), receiveRecordsStatusEnum);
        }
        return map;
    }
    public static MaterialReceiveRecordsStatusEnum getByCode(Byte code){
        return toMap().get(code);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/MaterialRevertStatusEnum.java
对比新文件
@@ -0,0 +1,47 @@
package com.gkhy.safePlatform.equipment.enums;
import java.util.HashMap;
import java.util.Map;
public enum MaterialRevertStatusEnum {
    REVERT_YES((byte) 0, "已归还"),
    REVERT_NO((byte) 1, "未归还"),
    DEPLETION((byte)2,"耗损");
    private Byte code;
    private String value;
    MaterialRevertStatusEnum(Byte code, String value) {
        this.code = code;
        this.value = value;
    }
    public Byte getCode() {
        return code;
    }
    public void setCode(Byte code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    // 转换成为 MAP<Byte, String>, 对外提供查询和遍历功能
    public static Map<Byte, MaterialRevertStatusEnum> toMap() {
        Map<Byte, MaterialRevertStatusEnum> map = new HashMap();
        for (MaterialRevertStatusEnum revertStatusEnum : MaterialRevertStatusEnum.values()) {
            map.put(revertStatusEnum.getCode(), revertStatusEnum);
        }
        return map;
    }
    public static MaterialRevertStatusEnum getByCode(Byte code){
        return toMap().get(code);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/MaterialStatusEnum.java
对比新文件
@@ -0,0 +1,50 @@
package com.gkhy.safePlatform.equipment.enums;
import java.util.HashMap;
import java.util.Map;
public enum MaterialStatusEnum {
    INTACT((byte) 0, "完好"),
    DAMAGE((byte) 1, "损坏"),
    LOSS((byte) 2, "丢失"),
    OVERDUE((byte) 3, "过期"),
    OTHER((byte) 4,"其他")
   ;
    private Byte code;
    private String value;
    MaterialStatusEnum(Byte code, String value) {
        this.code = code;
        this.value = value;
    }
    public Byte getCode() {
        return code;
    }
    public void setCode(Byte code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    // 转换成为 MAP<Byte, String>, 对外提供查询和遍历功能
    public static Map<Byte, MaterialStatusEnum> toMap() {
        Map<Byte, MaterialStatusEnum> map = new HashMap();
        for (MaterialStatusEnum materialStatusEnum : MaterialStatusEnum.values()) {
            map.put(materialStatusEnum.getCode(), materialStatusEnum);
        }
        return map;
    }
    public static MaterialStatusEnum getByCode(Byte code){
        return toMap().get(code);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/ValidStatusEnum.java
对比新文件
@@ -0,0 +1,46 @@
package com.gkhy.safePlatform.equipment.enums;
import java.util.HashMap;
import java.util.Map;
public enum ValidStatusEnum {
    YES((byte) 0, "是"),
    NO((byte) 1, "否");
    private Byte code;
    private String value;
    ValidStatusEnum(Byte code, String value) {
        this.code = code;
        this.value = value;
    }
    public Byte getCode() {
        return code;
    }
    public void setCode(Byte code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    // 转换成为 MAP<Byte, String>, 对外提供查询和遍历功能
    public static Map<Byte, ValidStatusEnum> toMap() {
        Map<Byte, ValidStatusEnum> map = new HashMap();
        for (ValidStatusEnum validStatusEnum : ValidStatusEnum.values()) {
            map.put(validStatusEnum.getCode(), validStatusEnum);
        }
        return map;
    }
    public static ValidStatusEnum getByCode(Byte code){
        return toMap().get(code);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/enums/ValidTypeEnum.java
对比新文件
@@ -0,0 +1,46 @@
package com.gkhy.safePlatform.equipment.enums;
import java.util.HashMap;
import java.util.Map;
public enum ValidTypeEnum {
    LONG_TERM((byte) 0, "长期"),
    SHORT_TERM((byte) 1, "非长期");
    private Byte code;
    private String value;
    ValidTypeEnum(Byte code, String value) {
        this.code = code;
        this.value = value;
    }
    public Byte getCode() {
        return code;
    }
    public void setCode(Byte code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    // 转换成为 MAP<Byte, String>, 对外提供查询和遍历功能
    public static Map<Byte, ValidTypeEnum> toMap() {
        Map<Byte, ValidTypeEnum> map = new HashMap();
        for (ValidTypeEnum consumableEnum : ValidTypeEnum.values()) {
            map.put(consumableEnum.getCode(), consumableEnum);
        }
        return map;
    }
    public static ValidTypeEnum getByCode(Byte code){
        return toMap().get(code);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/excepiton/EquipmentException.java
@@ -17,6 +17,11 @@
        this.code = error.getCode();
        this.message = error.getDesc();
    }
    public EquipmentException(EquipmentResultCodes equipmentResultCodes,String message) {
        super(message);
        this.code = equipmentResultCodes.getCode();
        this.message = message;
    }
    public EquipmentException(String code, String message) {
        super(message);
@@ -29,6 +34,11 @@
        this.code = clientParamIllegal.getCode();
        this.message = clientParamIllegal.getDesc();
    }
    public EquipmentException(ResultCodes resultCodes,String message) {
        super(message);
        this.code = resultCodes.getCode();
        this.message = message;
    }
    public String getCode() {
        return this.code;
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/handler/MyMetaObjectHandler.java
对比新文件
@@ -0,0 +1,34 @@
package com.gkhy.safePlatform.equipment.handler;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
@Component
public class MyMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now()); // 起始版本 3.3.0(推荐使用)
        this.strictInsertFill(metaObject, "createUid", Long.class, currentUser.getUid());
        this.strictInsertFill(metaObject, "createUname", String.class, currentUser.getUsername());
        this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now()); // 起始版本 3.3.0(推荐)
        this.strictInsertFill(metaObject, "updateUid", Long.class, currentUser.getUid());
        this.strictInsertFill(metaObject, "updateUname", String.class, currentUser.getUsername());
    }
    @Override
    public void updateFill(MetaObject metaObject) {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now()); // 起始版本 3.3.0(推荐)
        this.strictInsertFill(metaObject, "updateUid", Long.class, currentUser.getUid());
        this.strictInsertFill(metaObject, "updateUname", String.class, currentUser.getUsername());
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialClassifyQuery.java
对比新文件
@@ -0,0 +1,13 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
public class MaterialClassifyQuery {
    private String classifyName;
    public String getClassifyName() {
        return classifyName;
    }
    public void setClassifyName(String classifyName) {
        this.classifyName = classifyName;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialReceiveRecordsBaseReq.java
对比新文件
@@ -0,0 +1,27 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import javax.validation.constraints.NotNull;
import java.util.List;
public class MaterialReceiveRecordsBaseReq {
    @NotNull(message = "领取记录主键不可为空!")
    private Long receiveBaseId;
    @NotNull(message = "领取物资不可为空!")
    private List<MaterialReceiveRecordsReq> materialList;
    public Long getReceiveBaseId() {
        return receiveBaseId;
    }
    public void setReceiveBaseId(Long receiveBaseId) {
        this.receiveBaseId = receiveBaseId;
    }
    public List<MaterialReceiveRecordsReq> getMaterialList() {
        return materialList;
    }
    public void setMaterialList(List<MaterialReceiveRecordsReq> materialList) {
        this.materialList = materialList;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialReceiveRecordsQuery.java
对比新文件
@@ -0,0 +1,65 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDate;
public class MaterialReceiveRecordsQuery {
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate startTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate endTime;
    private String materialName;
    private Long depId;
    private Long receiveUid;
    private String receiveUname;
    public LocalDate getStartTime() {
        return startTime;
    }
    public void setStartTime(LocalDate startTime) {
        this.startTime = startTime;
    }
    public LocalDate getEndTime() {
        return endTime;
    }
    public void setEndTime(LocalDate endTime) {
        this.endTime = endTime;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialReceiveRecordsReq.java
对比新文件
@@ -0,0 +1,41 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
public class MaterialReceiveRecordsReq {
    /**
     * 领取物资id
     */
    private Long receiveId;
    /**
     * 物资状态
     */
    private Byte materialStatus;
    /**
     * 物资情况说明
     */
    private String remark;
    public Long getReceiveId() {
        return receiveId;
    }
    public void setReceiveId(Long receiveId) {
        this.receiveId = receiveId;
    }
    public Byte getMaterialStatus() {
        return materialStatus;
    }
    public void setMaterialStatus(Byte materialStatus) {
        this.materialStatus = materialStatus;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialSpwDeliveryReq.java
对比新文件
@@ -0,0 +1,39 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import javax.validation.constraints.NotNull;
public class MaterialSpwDeliveryReq {
    @NotNull(message = "主键不可为空!")
    private Integer count;
    @NotNull(message = "物资主键不可为空!")
    private Long smallClassifyId;
    @NotNull(message = "部门或者仓库不可为空!")
    private Long depId;
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MaterialSpwReq.java
对比新文件
@@ -0,0 +1,29 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import javax.validation.constraints.NotNull;
import java.util.List;
public class MaterialSpwReq {
    @NotNull(message = "认领人不可为空!")
    private Long claimantId;
    @NotNull(message = "出库物资不可为空!")
    private List<MaterialSpwDeliveryReq> deliveryReqList;
    public Long getClaimantId() {
        return claimantId;
    }
    public void setClaimantId(Long claimantId) {
        this.claimantId = claimantId;
    }
    public List<MaterialSpwDeliveryReq> getDeliveryReqList() {
        return deliveryReqList;
    }
    public void setDeliveryReqList(List<MaterialSpwDeliveryReq> deliveryReqList) {
        this.deliveryReqList = deliveryReqList;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MterialDeliveryReq.java
对比新文件
@@ -0,0 +1,28 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import javax.validation.constraints.NotNull;
import java.lang.annotation.Native;
import java.util.List;
public class MterialDeliveryReq {
    @NotNull(message = "主键不可为空!")
    private List<Long> ids;
    @NotNull(message = "认领人不可为空!")
    private Long receiveUid;
    public List<Long> getIds() {
        return ids;
    }
    public void setIds(List<Long> ids) {
        this.ids = ids;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/MterialRandomDeliveryReq.java
对比新文件
@@ -0,0 +1,48 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import javax.validation.constraints.NotNull;
import java.util.List;
public class MterialRandomDeliveryReq {
    @NotNull(message = "主键不可为空!")
    private Integer count;
    @NotNull(message = "认领人不可为空!")
    private Long receiveUid;
    @NotNull(message = "物资管理id不可为空!")
    private Long smId;
    private String rfid;
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/ParamForm.java
对比新文件
@@ -0,0 +1,23 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
 * @email 1603559716@qq.com
 * @author: zf
 * @date: 2022/11/25
 * @time: 13:48
 */
public class ParamForm {
    @NotNull(message = "参数不可为空!")
    List<Long> ids;
    public List<Long> getIds() {
        return ids;
    }
    public void setIds(List<Long> ids) {
        this.ids = ids;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialAddReq.java
对比新文件
@@ -0,0 +1,37 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
public class SafeMaterialAddReq {
    /**
     * 物资类型id
     */
    @NotNull(message = "物资类型(小类)不可为空!")
    private Long smallClassifyId;
    /**
     * 大类id
     */
    @NotNull(message = "物资类型(大类)不可为空!")
    private Long bigClassifyId;
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialClassifyAddReq.java
对比新文件
@@ -0,0 +1,45 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import javax.validation.constraints.NotBlank;
public class SafeMaterialClassifyAddReq {
    /**
     * 物资分类名称
     */
    @NotBlank(message = "物资名称不可为空")
    private String materialClassifyName;
    /**
     * 父级id
     */
    private Long ParentId;
    /**
     * 是否是耗材(0是,1否)
     */
    private Byte consumable;
    public String getMaterialClassifyName() {
        return materialClassifyName;
    }
    public void setMaterialClassifyName(String materialClassifyName) {
        this.materialClassifyName = materialClassifyName;
    }
    public Long getParentId() {
        return ParentId;
    }
    public void setParentId(Long parentId) {
        ParentId = parentId;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialClassifyModReq.java
对比新文件
@@ -0,0 +1,47 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
public class SafeMaterialClassifyModReq {
    /**
     * 主键
     */
    @NotNull(message = "主键不可为空")
    private Long id;
    /**
     * 物资分类名称
     */
    @NotBlank(message = "物资名称不可为空")
    private String materialClassifyName;
    /**
     * 是否是耗材(0是,1否)
     */
    private Byte consumable;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialClassifyName() {
        return materialClassifyName;
    }
    public void setMaterialClassifyName(String materialClassifyName) {
        this.materialClassifyName = materialClassifyName;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialClassifyQuery.java
对比新文件
@@ -0,0 +1,13 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
public class SafeMaterialClassifyQuery {
    private String materialClassifyName;
    public String getMaterialClassifyName() {
        return materialClassifyName;
    }
    public void setMaterialClassifyName(String materialClassifyName) {
        this.materialClassifyName = materialClassifyName;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialDetailAddReq.java
对比新文件
@@ -0,0 +1,79 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.Date;
public class SafeMaterialDetailAddReq {
    @NotNull(message = "物资不可为空!")
    private Long smId;
    private String startRfid;
    private String endRfid;
    @NotNull(message = "入库数量不可为空!")
    private Integer wareHousingCount;
    @NotNull(message = "有效期类型不可为空!")
    private Byte validType;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date validTime;
    //rfid
    private String rfid;
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public String getStartRfid() {
        return startRfid;
    }
    public void setStartRfid(String startRfid) {
        this.startRfid = startRfid;
    }
    public String getEndRfid() {
        return endRfid;
    }
    public void setEndRfid(String endRfid) {
        this.endRfid = endRfid;
    }
    public Integer getWareHousingCount() {
        return wareHousingCount;
    }
    public void setWareHousingCount(Integer wareHousingCount) {
        this.wareHousingCount = wareHousingCount;
    }
    public Byte getValidType() {
        return validType;
    }
    public void setValidType(Byte validType) {
        this.validType = validType;
    }
    public Date getValidTime() {
        return validTime;
    }
    public void setValidTime(Date validTime) {
        this.validTime = validTime;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialDetailReq.java
对比新文件
@@ -0,0 +1,111 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.Date;
public class SafeMaterialDetailReq {
    /**
     * 主键
     */
    @NotNull(message = "主键不可为空!")
    private Long id;
    /**
     * 物资类型id
     */
    private Long materialClassifyId;
    /**
     * RFID
     */
    private String rfid;
    /**
     * 保质期类型
     */
    private Byte validType;
    /**
     * 保质到期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date validTime;
    /**
     * 出入库状态
     */
    private Byte irStatus;
    /**
     * 安全物资字表id
     */
    private Long smId;
    /**
     * 认领人id
     */
    private Long receiveUid;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getMaterialClassifyId() {
        return materialClassifyId;
    }
    public void setMaterialClassifyId(Long materialClassifyId) {
        this.materialClassifyId = materialClassifyId;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public Byte getValidType() {
        return validType;
    }
    public void setValidType(Byte validType) {
        this.validType = validType;
    }
    public Date getValidTime() {
        return validTime;
    }
    public void setValidTime(Date validTime) {
        this.validTime = validTime;
    }
    public Byte getIrStatus() {
        return irStatus;
    }
    public void setIrStatus(Byte irStatus) {
        this.irStatus = irStatus;
    }
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialModReq.java
对比新文件
@@ -0,0 +1,43 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
import javax.validation.constraints.NotNull;
public class SafeMaterialModReq {
    @NotNull(message = "主键不可为空!")
    private Long id;
    /**
     * 物资类型id
     */
    @NotNull(message = "物资类型不可为空!")
    private Long smallClassifyId;
    /**
     * 大类id
     */
    @NotNull(message = "物资类型(大类)不可为空!")
    private Long bigClassifyId;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMaterialQuery.java
对比新文件
@@ -0,0 +1,38 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
public class SafeMaterialQuery {
    /**
     * 物资类型id
     */
    private Long bigClassifyId;
    /**
     * 物资名称
     */
    private String materialName;
    private Long depId;
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/SafeMatetrialDetailQuery.java
对比新文件
@@ -0,0 +1,32 @@
package com.gkhy.safePlatform.equipment.model.dto.req;
public class SafeMatetrialDetailQuery {
    private Byte irStatus;
    private String rfid;
    private Long smId;
    public Byte getIrStatus() {
        return irStatus;
    }
    public void setIrStatus(Byte irStatus) {
        this.irStatus = irStatus;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/req/db/SafeMaterialDetailDBQuery.java
对比新文件
@@ -0,0 +1,59 @@
package com.gkhy.safePlatform.equipment.model.dto.req.db;
public class SafeMaterialDetailDBQuery {
    private Byte irStatus;
    private String rfid;
    private Long depId;
    private Long smId;
    private Byte validStatus;
    private Integer count;
    public Byte getIrStatus() {
        return irStatus;
    }
    public void setIrStatus(Byte irStatus) {
        this.irStatus = irStatus;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public Byte getValidStatus() {
        return validStatus;
    }
    public void setValidStatus(Byte validStatus) {
        this.validStatus = validStatus;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/BaseMaterialDto.java
对比新文件
@@ -0,0 +1,46 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
public class BaseMaterialDto {
    //物资设备id
    private Long smId;
    //物资名称
    private String materialName;
    /**
     * 是否是耗材(0是, 1否)
     */
    private Byte consumable;
    private String consumableName;
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
    public String getConsumableName() {
        return consumableName;
    }
    public void setConsumableName(String consumableName) {
        this.consumableName = consumableName;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/MaterialClassificationDto.java
对比新文件
@@ -0,0 +1,35 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
import java.util.List;
public class MaterialClassificationDto {
    //物资类型id
    private Long materialClassifyId;
    //物资类型名称
    private String materialClassifyName;
    private List<BaseMaterialDto> baseMaterialList;
    public Long getMaterialClassifyId() {
        return materialClassifyId;
    }
    public void setMaterialClassifyId(Long materialClassifyId) {
        this.materialClassifyId = materialClassifyId;
    }
    public String getMaterialClassifyName() {
        return materialClassifyName;
    }
    public void setMaterialClassifyName(String materialClassifyName) {
        this.materialClassifyName = materialClassifyName;
    }
    public List<BaseMaterialDto> getBaseMaterialList() {
        return baseMaterialList;
    }
    public void setBaseMaterialList(List<BaseMaterialDto> baseMaterialList) {
        this.baseMaterialList = baseMaterialList;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/MaterialDepartmentDto.java
对比新文件
@@ -0,0 +1,36 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
import java.util.List;
public class MaterialDepartmentDto {
    //部门id
    private Long depId;
    //部门名称
    private String depName;
    //基础物资设备
    private List<MaterialClassificationDto> classificationList;
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public List<MaterialClassificationDto> getClassificationList() {
        return classificationList;
    }
    public void setClassificationList(List<MaterialClassificationDto> classificationList) {
        this.classificationList = classificationList;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/MaterialReceiveRecordsBaseDto.java
对比新文件
@@ -0,0 +1,174 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.util.List;
public class MaterialReceiveRecordsBaseDto {
    /**
     * 主键
     */
    private Long id;
    /**
     * 物资种类名称
     */
    private String materialName;
    /**
     * 领取人id
     */
    private Long receiveUid;
    /**
     * 领取人姓名
     */
    private String receiveUname;
    /**
     * 领取数量
     */
    private Integer receiveCount;
    /**
     * 归还数量
     */
    private Integer revertCount;
    private Integer consumeCount;
    /**
     * 归还情况(0未归还,1部分归还,2归还完成,3耗材无需归还)
     */
    private Byte status;
    /**
     * 归还情况
     */
    private String statusName;
    /**
     * 物资管理id
     */
    private Long smId;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public LocalDateTime createTime;
    private Long depId;
    private String depName;
    private List<MaterialReceiveRecordsDto> materialList;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Integer getReceiveCount() {
        return receiveCount;
    }
    public void setReceiveCount(Integer receiveCount) {
        this.receiveCount = receiveCount;
    }
    public Integer getRevertCount() {
        return revertCount;
    }
    public void setRevertCount(Integer revertCount) {
        this.revertCount = revertCount;
    }
    public Byte getStatus() {
        return status;
    }
    public void setStatus(Byte status) {
        this.status = status;
    }
    public String getStatusName() {
        return statusName;
    }
    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public List<MaterialReceiveRecordsDto> getMaterialList() {
        return materialList;
    }
    public void setMaterialList(List<MaterialReceiveRecordsDto> materialList) {
        this.materialList = materialList;
    }
    public Integer getConsumeCount() {
        return consumeCount;
    }
    public void setConsumeCount(Integer consumeCount) {
        this.consumeCount = consumeCount;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/MaterialReceiveRecordsDto.java
对比新文件
@@ -0,0 +1,193 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
public class MaterialReceiveRecordsDto {
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 物资名称
     */
    private String materialName;
    /**
     * 物资编号
     */
    private String materialNo;
    /**
     * rfid
     */
    private String rfid;
    /**
     * 领取时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime receiveTime;
    /**
     * 领取人id
     */
    private Long receiveUid;
    /**
     * 领取人姓名
     */
    private String receiveUname;
    /**
     * 归还状态(0未归还,1归还,3损耗)
     */
    private Byte revertStatus;
    /**
     * 归还状态
     */
    private String revertStatusName;
    /**
     * 物资状态
     */
    private Byte materialStatus;
    /**
     * 物资状态
     */
    private String materialStatusName;
    /**
     * 备注
     */
    private String remark;
    /**
     * 归还时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime revertTime;
    /**
     * 物资清单(详细物资)id
     */
    private Long smdId;
    /**
     * 基础记录id
     */
    private Long receiveBaseId;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public String getMaterialNo() {
        return materialNo;
    }
    public void setMaterialNo(String materialNo) {
        this.materialNo = materialNo;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public LocalDateTime getReceiveTime() {
        return receiveTime;
    }
    public void setReceiveTime(LocalDateTime receiveTime) {
        this.receiveTime = receiveTime;
    }
    public Long getReceiveUid() {
        return receiveUid;
    }
    public void setReceiveUid(Long receiveUid) {
        this.receiveUid = receiveUid;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Byte getRevertStatus() {
        return revertStatus;
    }
    public void setRevertStatus(Byte revertStatus) {
        this.revertStatus = revertStatus;
    }
    public String getRevertStatusName() {
        return revertStatusName;
    }
    public void setRevertStatusName(String revertStatusName) {
        this.revertStatusName = revertStatusName;
    }
    public Byte getMaterialStatus() {
        return materialStatus;
    }
    public void setMaterialStatus(Byte materialStatus) {
        this.materialStatus = materialStatus;
    }
    public String getMaterialStatusName() {
        return materialStatusName;
    }
    public void setMaterialStatusName(String materialStatusName) {
        this.materialStatusName = materialStatusName;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public LocalDateTime getRevertTime() {
        return revertTime;
    }
    public void setRevertTime(LocalDateTime revertTime) {
        this.revertTime = revertTime;
    }
    public Long getSmdId() {
        return smdId;
    }
    public void setSmdId(Long smdId) {
        this.smdId = smdId;
    }
    public Long getReceiveBaseId() {
        return receiveBaseId;
    }
    public void setReceiveBaseId(Long receiveBaseId) {
        this.receiveBaseId = receiveBaseId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeMaterialClassifyDto.java
对比新文件
@@ -0,0 +1,67 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
import java.util.List;
public class SafeMaterialClassifyDto {
    private Long id;
    private String materialClassifyName;
    private Long parentId;
    /**
     * 是否是耗材(0是,1否)
     */
    private Byte consumable;
    private String consumableName;
    private List<SafeMaterialClassifyDto> childList;
    public Long getParentId() {
        return parentId;
    }
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getMaterialClassifyName() {
        return materialClassifyName;
    }
    public void setMaterialClassifyName(String materialClassifyName) {
        this.materialClassifyName = materialClassifyName;
    }
    public List<SafeMaterialClassifyDto> getChildList() {
        return childList;
    }
    public void setChildList(List<SafeMaterialClassifyDto> childList) {
        this.childList = childList;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
    public String getConsumableName() {
        return consumableName;
    }
    public void setConsumableName(String consumableName) {
        this.consumableName = consumableName;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeMaterialClassifyStockDto.java
对比新文件
@@ -0,0 +1,40 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
public class SafeMaterialClassifyStockDto {
    private Long smallClassifyId;
    private Long depId;
    private String depName;
    private Integer stockCount;
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public Integer getStockCount() {
        return stockCount;
    }
    public void setStockCount(Integer stockCount) {
        this.stockCount = stockCount;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeMaterialDetailDto.java
对比新文件
@@ -0,0 +1,286 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import java.util.Date;
public class SafeMaterialDetailDto {
    /**
     * 主键
     */
    private Long id;
    /**
     * 物资名称
     */
    private String name;
    /**
     * 物资编号
     */
    private String materialNo;
    private Long bigClassifyId;
    /**
     * 物资类型名称
     */
    private String bigClassifyName;
    private Long depId;
    /**
     * 部门名称
     */
    private String depName;
    /**
     * RFID
     */
    private String rfid;
    /**
     * 耗材类型名称
     */
    private String consumableName;
    /**
     * 保质期类型
     */
    private Byte validType;
    /**
     * 保质期类型中文
     */
    private String validTypeName;
    /**
     * 保质到期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date validTime;
    /**
     * 状态
     */
    private Byte validStatus;
    /**
     * 有效状态
     */
    private String validStatusName;
    /**
     * 出入库状态
     */
    private Byte irStatus;
    /**
     * 出入库状态中文
     */
    private String irStatusName;
    /**
     *  入库时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime wareHousingTime;
    /**
     * 出库时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime deliveryTime;
    /**
     * 认领人姓名
     */
    private String receiveUname;
    /**
     * 物资状态
     */
    private Byte status;
    /**
     * 物资状态名称
     */
    private String statusName;
    /**
     * 描述
     */
    private String remark;
    /**
     * 安全物资管理id
     * @return
     */
    private Long smId;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getMaterialNo() {
        return materialNo;
    }
    public void setMaterialNo(String materialNo) {
        this.materialNo = materialNo;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public String getRfid() {
        return rfid;
    }
    public void setRfid(String rfid) {
        this.rfid = rfid;
    }
    public String getBigClassifyName() {
        return bigClassifyName;
    }
    public void setBigClassifyName(String bigClassifyName) {
        this.bigClassifyName = bigClassifyName;
    }
    public String getConsumableName() {
        return consumableName;
    }
    public void setConsumableName(String consumableName) {
        this.consumableName = consumableName;
    }
    public Byte getValidType() {
        return validType;
    }
    public void setValidType(Byte validType) {
        this.validType = validType;
    }
    public Date getValidTime() {
        return validTime;
    }
    public void setValidTime(Date validTime) {
        this.validTime = validTime;
    }
    public Byte getValidStatus() {
        return validStatus;
    }
    public void setValidStatus(Byte validStatus) {
        this.validStatus = validStatus;
    }
    public String getValidStatusName() {
        return validStatusName;
    }
    public void setValidStatusName(String validStatusName) {
        this.validStatusName = validStatusName;
    }
    public Byte getIrStatus() {
        return irStatus;
    }
    public void setIrStatus(Byte irStatus) {
        this.irStatus = irStatus;
    }
    public String getIrStatusName() {
        return irStatusName;
    }
    public void setIrStatusName(String irStatusName) {
        this.irStatusName = irStatusName;
    }
    public LocalDateTime getWareHousingTime() {
        return wareHousingTime;
    }
    public void setWareHousingTime(LocalDateTime wareHousingTime) {
        this.wareHousingTime = wareHousingTime;
    }
    public LocalDateTime getDeliveryTime() {
        return deliveryTime;
    }
    public void setDeliveryTime(LocalDateTime deliveryTime) {
        this.deliveryTime = deliveryTime;
    }
    public String getReceiveUname() {
        return receiveUname;
    }
    public void setReceiveUname(String receiveUname) {
        this.receiveUname = receiveUname;
    }
    public Byte getStatus() {
        return status;
    }
    public void setStatus(Byte status) {
        this.status = status;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getValidTypeName() {
        return validTypeName;
    }
    public void setValidTypeName(String validTypeName) {
        this.validTypeName = validTypeName;
    }
    public Long getSmId() {
        return smId;
    }
    public void setSmId(Long smId) {
        this.smId = smId;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getStatusName() {
        return statusName;
    }
    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeMaterialDto.java
对比新文件
@@ -0,0 +1,150 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
public class SafeMaterialDto {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 物资序列号  (如果以后id使用雪花算法时候再启用该字段)
     */
    private String serialNum;
    /**
     * 物资类型id
     */
    private Long bigClassifyId;
    private String bigClassifyName;
    private Long smallClassifyId;
    /**
     * 部门id
     */
    private Long depId;
    /**
     * 部门名称
     */
    private String depName;
    /**
     * 物资名称
     */
    private String materialName;
    /**
     * 是否是耗材(0是, 1否)
     */
    private Byte consumable;
    private String consumableName;
    /**
     * 有效库存数量
     */
    private Integer stockCount;
    /**
     * 总库存
     * @return
     */
    private Integer totalCount;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getSerialNum() {
        return serialNum;
    }
    public void setSerialNum(String serialNum) {
        this.serialNum = serialNum;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
    public String getDepName() {
        return depName;
    }
    public void setDepName(String depName) {
        this.depName = depName;
    }
    public String getMaterialName() {
        return materialName;
    }
    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }
    public Byte getConsumable() {
        return consumable;
    }
    public void setConsumable(Byte consumable) {
        this.consumable = consumable;
    }
    public String getConsumableName() {
        return consumableName;
    }
    public void setConsumableName(String consumableName) {
        this.consumableName = consumableName;
    }
    public Integer getStockCount() {
        return stockCount;
    }
    public void setStockCount(Integer stockCount) {
        this.stockCount = stockCount;
    }
    public Integer getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public String getBigClassifyName() {
        return bigClassifyName;
    }
    public void setBigClassifyName(String bigClassifyName) {
        this.bigClassifyName = bigClassifyName;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/model/dto/resp/SafeRfidMaterialDetailDto.java
对比新文件
@@ -0,0 +1,52 @@
package com.gkhy.safePlatform.equipment.model.dto.resp;
public class SafeRfidMaterialDetailDto {
    private Long id;
    private String name;
    private Long bigClassifyId;
    private Long smallClassifyId;
    private Long depId;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Long getBigClassifyId() {
        return bigClassifyId;
    }
    public void setBigClassifyId(Long bigClassifyId) {
        this.bigClassifyId = bigClassifyId;
    }
    public Long getSmallClassifyId() {
        return smallClassifyId;
    }
    public void setSmallClassifyId(Long smallClassifyId) {
        this.smallClassifyId = smallClassifyId;
    }
    public Long getDepId() {
        return depId;
    }
    public void setDepId(Long depId) {
        this.depId = depId;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/mq/consumer/SafeMaterialConsumer.java
对比新文件
@@ -0,0 +1,72 @@
package com.gkhy.safePlatform.equipment.mq.consumer;
import com.gkhy.safePlatform.commons.utils.CalcuteDelayLevelUtils;
import com.gkhy.safePlatform.commons.utils.JsonUtils;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfo;
import com.gkhy.safePlatform.equipment.enums.ValidStatusEnum;
import com.gkhy.safePlatform.equipment.mq.msg.SafeMaterialMsg;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialDetailInfoService;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.SendStatus;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.nio.charset.StandardCharsets;
import java.util.Date;
@Service
@RocketMQMessageListener(topic = "${rocketmq.topic.safeMaterialTopic}",consumerGroup = "${rocketmq.consumer.safeMaterialGroup}")
public class SafeMaterialConsumer implements RocketMQListener<MessageExt> {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Value("${rocketmq.topic.safeMaterialTopic}")
    private String safeMaterialTopic;
    @Autowired
    private RocketMQTemplate rocketMQTemplate;
    @Autowired
    private SafeMaterialDetailInfoService safeMaterialDetailInfoService;
    @Override
    @Transactional
    public void onMessage(MessageExt message) {
        try{
            SafeMaterialMsg msg = JsonUtils.parse(new String(message.getBody(), StandardCharsets.UTF_8),SafeMaterialMsg.class);
            if(null != msg && msg.getId()>0){
                //当前时间早于目标处理时间前0秒
                Long relaySeconds = (msg.getValidTime().getTime() - new Date().getTime())/1000;
                if(relaySeconds>0){
                    //重发消息,实现连续延时
                    Message reMsg = MessageBuilder.withPayload(msg).build();
                    SendResult sendResult = rocketMQTemplate.syncSend(safeMaterialTopic, reMsg, 10000, CalcuteDelayLevelUtils.calcuteDelayLevel(relaySeconds));
                    if(sendResult.getSendStatus() != SendStatus.SEND_OK){
                        throw new RuntimeException("【安全物资管理】重发消息失败" + msg.getId()+ "MSG_ID: "+ message.getMsgId());
                    }
                }else{//超时
                    SafeMaterialDetailInfo materialDetailInfo = safeMaterialDetailInfoService.queryById(msg.getId());
                    if(null != materialDetailInfo){
                        safeMaterialDetailInfoService.updateValidStatus(msg.getId());
                        logger.info("物资详细数据id:"+msg.getId()+" 物资过期!");
                    }
                }
            }
        }catch (Exception e){
            logger.error("【安全物资和设备管理】消息消费异常!"+ "MSG_ID: "+ message.getMsgId()+e);
        }
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/mq/msg/SafeMaterialMsg.java
对比新文件
@@ -0,0 +1,46 @@
package com.gkhy.safePlatform.equipment.mq.msg;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
public class SafeMaterialMsg {
    /**
     * 主键
     */
    private Long id ;
    /**
     * 有效类型
     */
    private Byte validStatus;
    /**
     * 有效期
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    private Date validTime;
    public Byte getValidStatus() {
        return validStatus;
    }
    public void setValidStatus(Byte validStatus) {
        this.validStatus = validStatus;
    }
    public Date getValidTime() {
        return validTime;
    }
    public void setValidTime(Date validTime) {
        this.validTime = validTime;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/MaterialReceiveRecordsBaseInfoRepository.java
对比新文件
@@ -0,0 +1,18 @@
package com.gkhy.safePlatform.equipment.repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseDO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseInfo;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface MaterialReceiveRecordsBaseInfoRepository extends BaseMapper<MaterialReceiveRecordsBaseInfo> {
    List<MaterialReceiveRecordsBaseDO> listByConditions(Page page, @Param("query") MaterialReceiveRecordsQuery query);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/MaterialReceiveRecordsInfoRepository.java
对比新文件
@@ -0,0 +1,23 @@
package com.gkhy.safePlatform.equipment.repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gkhy.safePlatform.equipment.entity.MaterialDeliveryRecordDO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsDO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface MaterialReceiveRecordsInfoRepository extends BaseMapper<MaterialReceiveRecordsInfo> {
    MaterialDeliveryRecordDO getRecordBySmdId(@Param("smdId") Long smdId, @Param("revertStatus") Byte revertStatus);
    List<MaterialReceiveRecordsDO> getNoReturnRecordByIds(@Param("idList") List<Long> idList, @Param("revertStatus") Byte revertStatus);
    List<MaterialReceiveRecordsDO> getReceiveRecordsByReceiveUids(MaterialReceiveRecordsBO bo);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/SafeMaterialClassifyInfoRepository.java
对比新文件
@@ -0,0 +1,31 @@
package com.gkhy.safePlatform.equipment.repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialClassifyQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SafeMaterialClassifyInfoRepository extends BaseMapper<SafeMaterialClassifyInfo> {
    int save(SafeMaterialClassifyInfo classifyInfo);
    int update(SafeMaterialClassifyInfo classifyInfo);
    SafeMaterialClassifyInfo queryById(@Param("id") Long id);
    List<SafeMaterialClassifyInfo> getListByParentId(Long parentId);
    SafeMaterialClassifyDO getBigAndSmallClassify(Long smallClassifyId);
    List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds);
    List<SafeMaterialClassifyInfo> listByConditions(Page<SafeMaterialClassifyInfo> page, @Param("query") MaterialClassifyQuery query);
    List<SafeMaterialClassifyInfo> getListByParentIds(List<Long> parentIdList);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/SafeMaterialDetailInfoRepository.java
对比新文件
@@ -0,0 +1,64 @@
package com.gkhy.safePlatform.equipment.repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gkhy.safePlatform.equipment.entity.*;
import com.gkhy.safePlatform.equipment.model.dto.req.db.SafeMaterialDetailDBQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.List;
@Repository
public interface SafeMaterialDetailInfoRepository extends BaseMapper<SafeMaterialDetailInfo> {
    Integer getTotalCount();
    SafeMaterialDetailInfo queryById(Long id);
    void updateReceiptStatus(@Param("id") Long id, @Param("status") Byte status,@Param("wareHousingTime") LocalDateTime wareHousingTime);
    List<SafeMaterialDetailInfo> getListByIds(List<Long> ids);
    void updateReceiptStatusByIds(@Param("ids") List<Long> ids, @Param("irStatus") Byte irStatus, @Param("wareHousingTime")LocalDateTime wareHousingTime);
    List<SafeMaterialDetailCountDO> getCountGroupBySmId(@Param("ids") List<Long> ids, @Param("irStatus") Byte irStatus);
    List<SafeMaterialDetailCountDO> getStatisticsValidStock(@Param("smIds") List<Long> smIds,@Param("validStatus") Byte validStatus,@Param("irStatus") Byte irStatus);
    void deleteBatch(List<Long> ids);
    void updateDeliveryStatusByIds(@Param("detailBO") SafeMaterialBatchDeliveryBO detailBO);
    Integer getValidStockCount(@Param("smId")Long smId, @Param("validStatus")Byte validStatus, @Param("irStatus")Byte irStatus);
    List<SafeMaterialDetailInfoDO> listByCondition(Page<SafeMaterialDetailInfo> page, @Param("query") SafeMaterialDetailDBQuery query);
    int getCountBySmIds(@Param("smIds") List<Long> smIds);
    int getCountBySmId(Long smId);
    void updateValidStatus(@Param("id") Long id, @Param("validStatus")Byte validStatus);
    List<Long> getRfidNotNullList(@Param("count") Integer count,@Param("smId")Long smId);
    List<Long> getRfidNullList(@Param("count") Integer count,@Param("smId") Long smId);
    List<Long> getIdListByRfid(Integer count, Long smId, String rfid);
    List<SafeMaterialClassifyStockDO> getSmallClassifyStockByIds(@Param("smallClassifyIds") List<Long> smallClassifyIds);
    List<SafeMaterialDetailDO> getListBySmallClassifyIds(List<Long> smallClassifyIds,@Param("depIds") List<Long> depIds);
    List<SafeMaterialDetailInfoDO> getListByRfids(List<String> rfids);
    void updateValidStatusByIds(@Param("ids")List<Long> ids, @Param("validStatus")Byte validStatus);
    List<SafeMaterialDetailInfo> getUnValidList(Byte validStatus);
    List<SafeMaterialDetailInfo> getListBySmIdAndRfid(@Param("query") SafeMaterialDetailDBQuery query);
    List<SafeMaterialDetailInfo> getListBySmId(@Param("query") SafeMaterialDetailDBQuery query);
    void updateBatch(List<SafeMaterialDetailInfo> list);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/repository/SafeMaterialInfoRepository.java
对比新文件
@@ -0,0 +1,33 @@
package com.gkhy.safePlatform.equipment.repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialBO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialDO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialInfo;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SafeMaterialInfoRepository extends BaseMapper<SafeMaterialInfo> {
    SafeMaterialDO queryById(Long id);
    int getTotalCount();
    int getCountByClassify(Long classifyId);
    int deleteBatch(List<Long> ids);
    List<SafeMaterialDO> listByConditions(Page<SafeMaterialDO> page, @Param("query") SafeMaterialQuery query);
    int getCountBySmallClassifyId(Long smallClassifyId);
    Integer checkMatrial(@Param("smallClassifyId") Long smallClassifyId, @Param("depId") Long depId,@Param("id")  Long id);
    void updateCountById(SafeMaterialBO safeMaterialBO);
    void updateStockCount(List<SafeMaterialBO> safeMaterialBOList);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/schedule/KeepAliveRobot.java
对比新文件
@@ -0,0 +1,28 @@
package com.gkhy.safePlatform.equipment.schedule;
import com.gkhy.safePlatform.equipment.service.EquipmentInfoService;
import com.gkhy.safePlatform.equipment.service.baseService.EquipmentInfoBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component("equipmentKeepAlive")
@EnableScheduling
@ConditionalOnProperty(prefix = "threadPool.scheduling", name = "enabled", havingValue = "true")
public class KeepAliveRobot {
    @Autowired
    private EquipmentInfoBaseService equipmentInfoBaseService;
    // 30m
    @Scheduled(cron = "0 0/30 * * * ?")
    public void keepAlive(){
        //
        equipmentInfoBaseService.getById(1L);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/MaterialClassifyService.java
对比新文件
@@ -0,0 +1,32 @@
package com.gkhy.safePlatform.equipment.service;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO;
import com.gkhy.safePlatform.equipment.model.dto.req.*;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto;
import java.util.List;
public interface MaterialClassifyService {
    List<SafeMaterialClassifyDto> list();
    ResultVO save(ContextCacheUser currentUser, SafeMaterialClassifyAddReq req);
    ResultVO update(ContextCacheUser currentUser, SafeMaterialClassifyModReq req);
    ResultVO delete(ContextCacheUser currentUser,Long id);
    SafeMaterialClassifyDto queryById(ContextCacheUser currentUser,Long id);
    SafeMaterialClassifyDO getBigAndSmallClassifyInfo(Long smallClassifyId);
    List<SafeMaterialClassifyDto> getClassifyListByIds(List<Long> ids);
    List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds);
    SearchResultVO<List<SafeMaterialClassifyDto>> listByPage(ContextCacheUser currentUser,PageQuery<MaterialClassifyQuery> pageQuery);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/MaterialReceiveRecordsService.java
对比新文件
@@ -0,0 +1,19 @@
package com.gkhy.safePlatform.equipment.service;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsDO;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsBaseReq;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsQuery;
import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialReceiveRecordsBaseDto;
import java.util.List;
public interface MaterialReceiveRecordsService {
    SearchResultVO<List<MaterialReceiveRecordsBaseDto>> listByPage(ContextCacheUser currentUser, PageQuery<MaterialReceiveRecordsQuery> pageQuery);
    void revertMaterial(ContextCacheUser currentUser, MaterialReceiveRecordsBaseReq req);
    List<MaterialReceiveRecordsDO> getReceiveRecordsByReceiveUids(MaterialReceiveRecordsBO bo);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/SafeMaterialDetailService.java
对比新文件
@@ -0,0 +1,44 @@
package com.gkhy.safePlatform.equipment.service;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.model.dto.req.*;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialDetailDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeRfidMaterialDetailDto;
import java.util.List;
public interface SafeMaterialDetailService {
    ResultVO save(SafeMaterialDetailAddReq req);
    void singleDelivery(ContextCacheUser currentUser,SafeMaterialDetailReq req);
    void singleReceipt(Long id,ContextCacheUser currentUser);
    ResultVO delete(Long id);
    ResultVO saveBatch(SafeMaterialDetailAddReq req);
    ResultVO update(SafeMaterialDetailReq req);
    ResultVO receiptBatch(ParamForm paramForm);
    ResultVO deleteBatch(ContextCacheUser currentUser,ParamForm paramForm);
    void deliveryBatchByIds(MterialDeliveryReq req,ContextCacheUser currentUser);
    void deliveryBatchBySmId(MterialRandomDeliveryReq req,ContextCacheUser currentUser);
    SearchResultVO<List<SafeMaterialDetailDto>> listByPage(ContextCacheUser currentUser,PageQuery<SafeMatetrialDetailQuery> pageQuery);
    ResultVO queryById(Long id);
    List<SafeMaterialClassifyStockDto> getSmallClassifyStockByIds(List<Long> smallClassifyIds);
    void deliveryBatchSpw(MaterialSpwReq req);
    List<SafeRfidMaterialDetailDto> getListByRfids(List<String> rfids);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/SafeMaterialService.java
对比新文件
@@ -0,0 +1,31 @@
package com.gkhy.safePlatform.equipment.service;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.model.dto.req.ParamForm;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialAddReq;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialModReq;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialQuery;
import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialClassificationDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialDepartmentDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialDto;
import java.util.List;
public interface SafeMaterialService {
    ResultVO save(ContextCacheUser currentUser,SafeMaterialAddReq req);
    ResultVO update(ContextCacheUser currentUser,SafeMaterialModReq req);
    ResultVO queryById(ContextCacheUser currentUser,Long id);
    ResultVO delete(ContextCacheUser currentUser,Long id);
    ResultVO deleteBatch(ContextCacheUser currentUser, ParamForm paramForm);
    List<MaterialDepartmentDto> list(ContextCacheUser currentUser);
    List<MaterialClassificationDto> listByDepId(ContextCacheUser currentUser);
    SearchResultVO<List<SafeMaterialDto>> listByPage(ContextCacheUser currentUser,PageQuery<SafeMaterialQuery> pageQuery);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/MaterialReceiveRecordsBaseInfoService.java
对比新文件
@@ -0,0 +1,15 @@
package com.gkhy.safePlatform.equipment.service.baseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseDO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseInfo;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsQuery;
import java.util.List;
public interface MaterialReceiveRecordsBaseInfoService extends IService<MaterialReceiveRecordsBaseInfo>  {
    List<MaterialReceiveRecordsBaseDO> listByPage(Page page, MaterialReceiveRecordsQuery query);
    MaterialReceiveRecordsBaseInfo queryById(Long receiveBaseId);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/MaterialReceiveRecordsInfoService.java
对比新文件
@@ -0,0 +1,22 @@
package com.gkhy.safePlatform.equipment.service.baseService;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gkhy.safePlatform.equipment.entity.MaterialDeliveryRecordDO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsDO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsInfo;
import java.util.List;
public interface MaterialReceiveRecordsInfoService extends IService<MaterialReceiveRecordsInfo> {
    MaterialDeliveryRecordDO getRecordBySmdId(Long smdId);
    List<MaterialReceiveRecordsInfo> getNoReturnRecordByReceiveBaseId(Long receiveBaseId);
    List<MaterialReceiveRecordsDO> getNoReturnRecordByIds(List<Long> idList);
    List<MaterialReceiveRecordsInfo> listByReceiveBaseIds(List<Long> idList);
    List<MaterialReceiveRecordsDO> getReceiveRecordsByReceiveUids(MaterialReceiveRecordsBO bo);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/SafeMaterialClassifyInfoService.java
对比新文件
@@ -0,0 +1,37 @@
package com.gkhy.safePlatform.equipment.service.baseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyStockDO;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialClassifyQuery;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyQuery;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyDto;
import java.util.List;
public interface SafeMaterialClassifyInfoService extends IService<SafeMaterialClassifyInfo> {
    SafeMaterialClassifyInfo queryById(Long id);
    boolean save(SafeMaterialClassifyInfo classifyInfo);
    int update(SafeMaterialClassifyInfo classifyInfo);
    List<SafeMaterialClassifyInfo> list();
    List<SafeMaterialClassifyInfo> getParentList();
    List<SafeMaterialClassifyInfo> getListByParentId(Long parentId);
    SafeMaterialClassifyDO getBigAndSmallClassify(Long smallClassifyId);
    List<SafeMaterialClassifyInfo> getClassifyListByIds(List<Long> smallClassifyIds);
    List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds);
    List<SafeMaterialClassifyInfo> listByPage(Page<SafeMaterialClassifyInfo> page, MaterialClassifyQuery query);
    List<SafeMaterialClassifyInfo> getListByParentIds(List<Long> parentIdList);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/SafeMaterialDetailInfoService.java
对比新文件
@@ -0,0 +1,65 @@
package com.gkhy.safePlatform.equipment.service.baseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gkhy.safePlatform.equipment.entity.*;
import com.gkhy.safePlatform.equipment.model.dto.req.db.SafeMaterialDetailDBQuery;
import java.util.List;
public interface SafeMaterialDetailInfoService extends IService<SafeMaterialDetailInfo> {
    Integer getTotalCount();
    SafeMaterialDetailInfo queryById(Long id);
    void updateReceiptStatus(Long id, Byte status);
    List<SafeMaterialDetailInfo> getListByIds(List<Long> ids);
    void updateReceiptStatusByIds(List<Long> ids, Byte irStatus);
    List<SafeMaterialDetailCountDO> getCountGroupBySmId(List<Long> ids, Byte irStatus);
    List<SafeMaterialDetailCountDO> getStatisticsValidStock(List<Long> smIds);
    void deleteBatch(List<Long> ids);
    void updateDeliveryStatusByIds(SafeMaterialBatchDeliveryBO detailBO);
    Integer getValidStockCount(Long smId);
    List<SafeMaterialDetailInfoDO> listByPage(Page<SafeMaterialDetailInfo> page, SafeMaterialDetailDBQuery query);
    int getCountBySmIds(List<Long> smIds);
    int getCountBySmId(Long smId);
    void updateValidStatus(Long id);
    List<Long> getRfidNotNullList(Integer count, Long smId);
    List<Long> getRfidNullList(Integer count, Long smId);
    List<Long> getIdListByRfid(Integer count, Long smId, String rfid);
    List<SafeMaterialClassifyStockDO> getSmallClassifyStockByIds(List<Long> smallClassifyIds);
    List<SafeMaterialDetailDO> getListBySmallClassifyIds(List<Long> smallClassifyIds,List<Long> depIds);
    List<SafeMaterialDetailInfoDO> getListByRfids(List<String> rfid);
    List<SafeMaterialDetailInfo> getUnValidList();
    void updateValidStatusByIds(List<Long> ids);
    List<SafeMaterialDetailInfo> getListBySmIdAndRfid(SafeMaterialDetailDBQuery query);
    List<SafeMaterialDetailInfo> getListBySmId(SafeMaterialDetailDBQuery query);
    void updateBatch(List<SafeMaterialDetailInfo> safeMaterialDetailInfoList);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/SafeMaterialInfoService.java
对比新文件
@@ -0,0 +1,35 @@
package com.gkhy.safePlatform.equipment.service.baseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialBO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialDO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialInfo;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialQuery;
import java.util.List;
public interface SafeMaterialInfoService extends IService<SafeMaterialInfo> {
    int getTotalCount();
    SafeMaterialDO queryById(Long id);
    int deleteBatch(List<Long> ids);
    List<SafeMaterialInfo> list();
    List<SafeMaterialDO> listByPage(Page<SafeMaterialDO> page, SafeMaterialQuery query);
    int getCountBySmallClassifyId(Long smallClassifyId);
    boolean checkMaterial(Long smallClassifyId, Long depId, Long id);
    void updateCountById(SafeMaterialBO safeMaterialBO);
    List<SafeMaterialInfo> listByDepId(Long depId);
    void updateStockCount(List<SafeMaterialBO> safeMaterialBOList);
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/MaterialReceiveRecordsBaseInfoServiceImpl.java
对比新文件
@@ -0,0 +1,29 @@
package com.gkhy.safePlatform.equipment.service.baseService.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseDO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseInfo;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsQuery;
import com.gkhy.safePlatform.equipment.repository.MaterialReceiveRecordsBaseInfoRepository;
import com.gkhy.safePlatform.equipment.service.baseService.MaterialReceiveRecordsBaseInfoService;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class MaterialReceiveRecordsBaseInfoServiceImpl extends ServiceImpl<MaterialReceiveRecordsBaseInfoRepository,MaterialReceiveRecordsBaseInfo> implements MaterialReceiveRecordsBaseInfoService {
    @Override
    public List<MaterialReceiveRecordsBaseDO> listByPage(Page page, MaterialReceiveRecordsQuery query) {
        return baseMapper.listByConditions(page,query);
    }
    @Override
    public MaterialReceiveRecordsBaseInfo queryById(Long receiveBaseId) {
        MaterialReceiveRecordsBaseInfo receiveRecordsBaseInfo = baseMapper.selectOne(new LambdaQueryWrapper<MaterialReceiveRecordsBaseInfo>()
                .eq(MaterialReceiveRecordsBaseInfo::getId, receiveBaseId)
                .eq(MaterialReceiveRecordsBaseInfo::getDelFlag, 0));
        return receiveRecordsBaseInfo;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/MaterialReceiveRecordsInfoServiceImpl.java
对比新文件
@@ -0,0 +1,69 @@
package com.gkhy.safePlatform.equipment.service.baseService.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.equipment.entity.MaterialDeliveryRecordDO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsDO;
import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsInfo;
import com.gkhy.safePlatform.equipment.enums.MaterialRevertStatusEnum;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.repository.MaterialReceiveRecordsInfoRepository;
import com.gkhy.safePlatform.equipment.service.baseService.MaterialReceiveRecordsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
@Service
public class MaterialReceiveRecordsInfoServiceImpl extends ServiceImpl<MaterialReceiveRecordsInfoRepository, MaterialReceiveRecordsInfo> implements MaterialReceiveRecordsInfoService {
    @Autowired
    private MaterialReceiveRecordsInfoRepository repository;
    @Override
    public MaterialDeliveryRecordDO getRecordBySmdId(Long smdId) {
        if(null == smdId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getRecordBySmdId(smdId,MaterialRevertStatusEnum.REVERT_NO.getCode());
    }
    @Override
    public List<MaterialReceiveRecordsInfo> getNoReturnRecordByReceiveBaseId(Long receiveBaseId) {
        if(null == receiveBaseId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        List<MaterialReceiveRecordsInfo> recordsInfos = repository.selectList(new LambdaQueryWrapper<MaterialReceiveRecordsInfo>()
                .eq(MaterialReceiveRecordsInfo::getReceiveBaseId, receiveBaseId)
                .eq(MaterialReceiveRecordsInfo::getRevertStatus, MaterialRevertStatusEnum.REVERT_NO.getCode()));
        return recordsInfos;
    }
    @Override
    public List<MaterialReceiveRecordsDO> getNoReturnRecordByIds(List<Long> idList) {
        if (CollectionUtils.isEmpty(idList)) {
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        List<MaterialReceiveRecordsDO> records = repository.getNoReturnRecordByIds(idList, MaterialRevertStatusEnum.REVERT_NO.getCode());
        return records;
    }
    @Override
    public List<MaterialReceiveRecordsInfo> listByReceiveBaseIds(List<Long> idList) {
        if (CollectionUtils.isEmpty(idList)) {
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        List<MaterialReceiveRecordsInfo> receiveRecordsInfoList = repository.selectList(new LambdaQueryWrapper<MaterialReceiveRecordsInfo>()
                .in(MaterialReceiveRecordsInfo::getReceiveBaseId, idList));
        return receiveRecordsInfoList;
    }
    @Override
    public List<MaterialReceiveRecordsDO> getReceiveRecordsByReceiveUids(MaterialReceiveRecordsBO bo) {
        if (CollectionUtils.isEmpty(bo.getReceiveUids()) || CollectionUtils.isEmpty(bo.getSmallClassifyIds())) {
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getReceiveRecordsByReceiveUids(bo);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialClassifyInfoServiceImpl.java
对比新文件
@@ -0,0 +1,119 @@
package com.gkhy.safePlatform.equipment.service.baseService.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.utils.StringUtils;
import com.gkhy.safePlatform.equipment.entity.*;
import com.gkhy.safePlatform.equipment.enums.IssueReceiptEnum;
import com.gkhy.safePlatform.equipment.enums.ValidStatusEnum;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialClassifyQuery;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyQuery;
import com.gkhy.safePlatform.equipment.repository.SafeMaterialClassifyInfoRepository;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialClassifyInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.io.InputStream;
import java.util.List;
@Service("SafeMaterialClassifyInfoService")
public class SafeMaterialClassifyInfoServiceImpl extends ServiceImpl<SafeMaterialClassifyInfoRepository, SafeMaterialClassifyInfo> implements SafeMaterialClassifyInfoService {
   @Autowired
   private SafeMaterialClassifyInfoRepository repository;
   @Override
   public boolean save(SafeMaterialClassifyInfo classifyInfo) {
       boolean flag = true;
       int i = repository.save(classifyInfo);
       if(i == 0){
           flag = false;
       }
        return flag;
   }
    //@Override
    public int update(SafeMaterialClassifyInfo classifyInfo) {
       if(classifyInfo.getId() == null){
           throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
       }
        int i = repository.update(classifyInfo);
        return i;
    }
    @Override
    public SafeMaterialClassifyInfo queryById(Long id) {
       if(id == null){
           throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
       }
        return repository.queryById(id);
    }
    @Override
    public List<SafeMaterialClassifyInfo> list(){
        List<SafeMaterialClassifyInfo> list = repository.selectList(new LambdaQueryWrapper<SafeMaterialClassifyInfo>()
                .eq(SafeMaterialClassifyInfo::getDelFlag, 0)
        );
        return list;
    }
    @Override
    public List<SafeMaterialClassifyInfo> getParentList(){
        List<SafeMaterialClassifyInfo> list = repository.selectList(new LambdaQueryWrapper<SafeMaterialClassifyInfo>()
                .eq(SafeMaterialClassifyInfo::getDelFlag,0)
                .eq(SafeMaterialClassifyInfo::getParentId,0l));
        return list;
    }
    @Override
    public List<SafeMaterialClassifyInfo> getListByParentId(Long parentId) {
       if(null == parentId){
           throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
       }
        return repository.getListByParentId(parentId);
    }
    @Override
    public SafeMaterialClassifyDO getBigAndSmallClassify(Long smallClassifyId) {
        if(null == smallClassifyId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getBigAndSmallClassify(smallClassifyId);
    }
    @Override
    public List<SafeMaterialClassifyInfo> getClassifyListByIds(List<Long> ids) {
       if(CollectionUtils.isEmpty(ids)){
           throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
       }
        return repository.selectList(new LambdaQueryWrapper<SafeMaterialClassifyInfo>()
                .eq(SafeMaterialClassifyInfo::getDelFlag,0)
                .in(SafeMaterialClassifyInfo::getId,ids)
        );
    }
    @Override
    public List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds) {
       if(CollectionUtils.isEmpty(smallClassifyIds)){
           throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getTraceabilityClassifyList(smallClassifyIds);
    }
    @Override
    public List<SafeMaterialClassifyInfo> listByPage(Page<SafeMaterialClassifyInfo> page, MaterialClassifyQuery query) {
        return repository.listByConditions(page,query);
    }
    @Override
    public List<SafeMaterialClassifyInfo> getListByParentIds(List<Long> parentIdList) {
       if (CollectionUtils.isEmpty(parentIdList)){
           throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
       }
        return repository.getListByParentIds(parentIdList);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialDetailInfoServiceImpl.java
对比新文件
@@ -0,0 +1,213 @@
package com.gkhy.safePlatform.equipment.service.baseService.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.equipment.entity.*;
import com.gkhy.safePlatform.equipment.enums.IssueReceiptEnum;
import com.gkhy.safePlatform.equipment.enums.ValidStatusEnum;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.model.dto.req.db.SafeMaterialDetailDBQuery;
import com.gkhy.safePlatform.equipment.repository.SafeMaterialDetailInfoRepository;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialDetailInfoService;
import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.List;
@Service("SafeMaterialDetailInfoService")
public class SafeMaterialDetailInfoServiceImpl extends ServiceImpl<SafeMaterialDetailInfoRepository, SafeMaterialDetailInfo> implements SafeMaterialDetailInfoService {
    @Autowired
    private SafeMaterialDetailInfoRepository repository;
    @Override
    public Integer getTotalCount() {
        return repository.getTotalCount();
    }
    @Override
    public SafeMaterialDetailInfo queryById(Long id) {
        if(null == id){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.queryById(id);
    }
    @Override
    public void updateReceiptStatus(Long id, Byte status) {
        if(null == id || null == status){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        repository.updateReceiptStatus(id,status,LocalDateTime.now());
    }
    @Override
    public List<SafeMaterialDetailInfo> getListByIds(List<Long> ids) {
        if(CollectionUtils.isEmpty(ids)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getListByIds(ids);
    }
    @Override
    public void updateReceiptStatusByIds(List<Long> ids, Byte irStatus) {
        if(CollectionUtils.isEmpty(ids) || null == irStatus){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        repository.updateReceiptStatusByIds(ids,irStatus,LocalDateTime.now());
    }
    @Override
    public List<SafeMaterialDetailCountDO> getCountGroupBySmId(List<Long> ids, Byte irStatus) {
        if(!CollectionUtils.isEmpty(ids) || null == irStatus){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getCountGroupBySmId(ids,irStatus);
    }
    @Override
    public List<SafeMaterialDetailCountDO> getStatisticsValidStock(List<Long> smIds) {
        return repository.getStatisticsValidStock(smIds, ValidStatusEnum.YES.getCode(), IssueReceiptEnum.IN_THE_LIBRARY.getCode());
    }
    @Override
    public void deleteBatch(List<Long> ids) {
        if(CollectionUtils.isEmpty(ids)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        repository.deleteBatch(ids);
    }
    @Override
    public void updateDeliveryStatusByIds(SafeMaterialBatchDeliveryBO detailBO) {
        if(CollectionUtils.isEmpty(detailBO.getIds()) || null == detailBO.getReceiveUid() || StringUtil.isBlank(detailBO.getReceiveUname())){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        detailBO.setIrStatus(IssueReceiptEnum.OUT_OF_LIBRARY.getCode());
        detailBO.setDeliveryTime(LocalDateTime.now());
        repository.updateDeliveryStatusByIds(detailBO);
    }
    @Override
    public Integer getValidStockCount(Long smId) {
        if(null == smId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        Integer count = repository.getValidStockCount(smId,ValidStatusEnum.YES.getCode(),IssueReceiptEnum.IN_THE_LIBRARY.getCode());
        return count;
    }
    @Override
    public List<SafeMaterialDetailInfoDO> listByPage(Page<SafeMaterialDetailInfo> page, SafeMaterialDetailDBQuery query) {
        return repository.listByCondition(page,query);
    }
    @Override
    public int getCountBySmIds(List<Long> smIds) {
        if(null == smIds || smIds.size() == 0){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getCountBySmIds(smIds);
    }
    @Override
    public int getCountBySmId(Long smId) {
        if(null == smId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getCountBySmId(smId);
    }
    @Override
    public void updateValidStatus(Long id) {
        if(null == id){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        repository.updateValidStatus(id,ValidStatusEnum.NO.getCode());
    }
    @Override
    public List<Long> getRfidNotNullList(Integer count,Long smId) {
        if(null == count || null == smId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getRfidNotNullList(count,smId);
    }
    @Override
    public List<Long> getRfidNullList(Integer count,Long smId) {
        if(null == count || null == smId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getRfidNullList(count,smId);
    }
    @Override
    public List<Long> getIdListByRfid(Integer count, Long smId, String rfid) {
        return repository.getIdListByRfid(count,smId,rfid);
    }
    @Override
    public List<SafeMaterialClassifyStockDO> getSmallClassifyStockByIds(List<Long> smallClassifyIds) {
        if(CollectionUtils.isEmpty(smallClassifyIds) ){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getSmallClassifyStockByIds(smallClassifyIds);
    }
    @Override
    public List<SafeMaterialDetailDO> getListBySmallClassifyIds(List<Long> smallClassifyIds,List<Long> depIds) {
        if(CollectionUtils.isEmpty(smallClassifyIds) || CollectionUtils.isEmpty(depIds)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getListBySmallClassifyIds(smallClassifyIds,depIds);
    }
    @Override
    public List<SafeMaterialDetailInfoDO> getListByRfids(List<String> rfids) {
        if(CollectionUtils.isEmpty(rfids)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getListByRfids(rfids);
    }
    @Override
    public List<SafeMaterialDetailInfo> getUnValidList() {
        return repository.getUnValidList(ValidStatusEnum.YES.getCode());
    }
    @Override
    public void updateValidStatusByIds(List<Long> ids) {
        if(CollectionUtils.isEmpty(ids)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        repository.updateValidStatusByIds(ids,ValidStatusEnum.NO.getCode());
    }
    @Override
    public List<SafeMaterialDetailInfo> getListBySmIdAndRfid(SafeMaterialDetailDBQuery query) {
        List<SafeMaterialDetailInfo> list = repository.getListBySmIdAndRfid(query);
        return list;
    }
    @Override
    public List<SafeMaterialDetailInfo> getListBySmId(SafeMaterialDetailDBQuery query) {
        List<SafeMaterialDetailInfo> list = repository.getListBySmId(query);
        return list;
    }
    @Override
    public void updateBatch(List<SafeMaterialDetailInfo> list) {
        if(CollectionUtils.isEmpty(list)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        repository.updateBatch(list);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/baseService/impl/SafeMaterialInfoServiceImpl.java
对比新文件
@@ -0,0 +1,112 @@
package com.gkhy.safePlatform.equipment.service.baseService.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.utils.StringUtils;
import com.gkhy.safePlatform.equipment.entity.*;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialQuery;
import com.gkhy.safePlatform.equipment.repository.SafeMaterialInfoRepository;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
@Service("SafeMaterialInfoService")
public class SafeMaterialInfoServiceImpl extends ServiceImpl<SafeMaterialInfoRepository, SafeMaterialInfo> implements SafeMaterialInfoService {
    @Autowired
    private SafeMaterialInfoRepository repository;
    /**
     * 获取所有数据,包括被删除的
     * @return
     */
    @Override
    public int getTotalCount() {
        return repository.getTotalCount();
    }
    @Override
    public SafeMaterialDO queryById(Long id) {
        if(null == id){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.queryById(id);
    }
    @Override
    public int deleteBatch(List<Long> ids) {
        if(null == ids || ids.size() == 0){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        repository.deleteBatch(ids);
        return 0;
    }
    @Override
    public List<SafeMaterialInfo> list(){
        List<SafeMaterialInfo> safeMaterialInfos = repository.selectList(new LambdaQueryWrapper<SafeMaterialInfo>()
                .eq(SafeMaterialInfo::getDelFlag, 0));
        return safeMaterialInfos;
    }
    @Override
    public List<SafeMaterialDO> listByPage(Page<SafeMaterialDO> page, SafeMaterialQuery query) {
        List<SafeMaterialDO> materialInfoList = repository.listByConditions(page, query);
        return materialInfoList;
    }
    @Override
    public int getCountBySmallClassifyId(Long smallClassifyId) {
        if(null == smallClassifyId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return repository.getCountBySmallClassifyId(smallClassifyId);
    }
    @Override
    public boolean checkMaterial(Long smallClassifyId, Long depId, Long id) {
        if(null == depId || null == smallClassifyId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        boolean flag = false;
        int i = repository.checkMatrial(smallClassifyId,depId,id);
        if (i>0){
            flag = true;
        }
        return flag;
    }
    @Override
    public void updateCountById(SafeMaterialBO safeMaterialBO) {
        if(null == safeMaterialBO){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        repository.updateCountById(safeMaterialBO);
    }
    @Override
    public List<SafeMaterialInfo> listByDepId(Long depId) {
        if(null == depId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        List<SafeMaterialInfo> safeMaterialInfoList = repository.selectList(new LambdaQueryWrapper<SafeMaterialInfo>()
                .eq(SafeMaterialInfo::getDelFlag, 0)
                .eq(SafeMaterialInfo::getDepId, depId));
        return safeMaterialInfoList;
    }
    @Override
    public void updateStockCount(List<SafeMaterialBO> safeMaterialBOList) {
        if(CollectionUtils.isEmpty(safeMaterialBOList)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        repository.updateStockCount(safeMaterialBOList);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/impl/MaterialClassifyServiceImpl.java
对比新文件
@@ -0,0 +1,294 @@
package com.gkhy.safePlatform.equipment.service.impl;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.utils.BeanCopyUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO;
import com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo;
import com.gkhy.safePlatform.equipment.enums.ConsumableEnum;
import com.gkhy.safePlatform.equipment.enums.EquipmentResultCodes;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialClassifyQuery;
import com.gkhy.safePlatform.equipment.model.dto.req.ParamForm;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyAddReq;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialClassifyModReq;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto;
import com.gkhy.safePlatform.equipment.service.MaterialClassifyService;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialClassifyInfoService;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialInfoService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service("MaterialClassifyService")
public class MaterialClassifyServiceImpl implements MaterialClassifyService {
    @Autowired
    private SafeMaterialClassifyInfoService safeMaterialClassifyInfoService;
    @Autowired
    private SafeMaterialInfoService safeMaterialInfoService;
    @Override
    public List<SafeMaterialClassifyDto> list() {
        List<SafeMaterialClassifyInfo> list = safeMaterialClassifyInfoService.list();
        //过滤出父级
        List<SafeMaterialClassifyInfo> parentList = list
                .stream()
                .filter(item -> item.getParentId().equals(0l))
                .collect(Collectors.toList());
        List<SafeMaterialClassifyDto> respDTOList = new ArrayList<>();
        //只有二级不采用递归
        for (SafeMaterialClassifyInfo classifyInfo:parentList) {
            SafeMaterialClassifyDto respDTO = new SafeMaterialClassifyDto();
            respDTO.setId(classifyInfo.getId());
            respDTO.setMaterialClassifyName(classifyInfo.getMaterialClassifyName());
            respDTO.setParentId(classifyInfo.getParentId());
            List<SafeMaterialClassifyInfo> childList = list
                    .stream()
                    .filter(item -> item.getParentId().equals(classifyInfo.getId()))
                    .collect(Collectors.toList());
            List<SafeMaterialClassifyDto> childDTOList = new ArrayList<>();
            for (SafeMaterialClassifyInfo child:childList){
                SafeMaterialClassifyDto childDTO = new SafeMaterialClassifyDto();
                childDTO.setId(child.getId());
                childDTO.setMaterialClassifyName(child.getMaterialClassifyName());
                if(null != child.getConsumable()){
                    childDTO.setConsumableName(ConsumableEnum.getByCode(child.getConsumable()).getValue());
                }
                childDTO.setConsumable(child.getConsumable());
                childDTO.setParentId(child.getParentId());
                childDTOList.add(childDTO);
            }
            respDTO.setChildList(childDTOList);
            respDTOList.add(respDTO);
        }
        return respDTOList;
    }
    @Override
    public ResultVO save(ContextCacheUser currentUser, SafeMaterialClassifyAddReq req) {
        ResultVO resultVO = null;
        if(null != req.getParentId()){
            if(null == req.getConsumable()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"是否耗材未选择");
            }
            if(null == ConsumableEnum.getByCode(req.getConsumable())){
                throw new EquipmentException(EquipmentResultCodes.DATA_ILLEGAL);
            }
        }
        SafeMaterialClassifyInfo classifyInfo = new SafeMaterialClassifyInfo();
        classifyInfo.setId(IdUtil.getSnowflake(0,0).nextId());
        classifyInfo.setMaterialClassifyName(req.getMaterialClassifyName());
        classifyInfo.setConsumable(req.getConsumable());
        if(null != req.getParentId()){
            classifyInfo.setParentId(req.getParentId());
        }else{
            classifyInfo.setParentId(0l);
        }
        boolean flag = safeMaterialClassifyInfoService.save(classifyInfo);
        if (flag){
            resultVO = new ResultVO(ResultCodes.OK);
        }else {
            resultVO = new ResultVO(ResultCodes.SERVER_ADD_ERROR);
        }
        return  resultVO;
    }
    @Override
    public ResultVO update(ContextCacheUser currentUser, SafeMaterialClassifyModReq req) {
        ResultVO resultVO = null;
        if(req.getId() == null){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        SafeMaterialClassifyInfo safeMaterialClassifyInfo = safeMaterialClassifyInfoService.queryById(req.getId());
        if(safeMaterialClassifyInfo.getParentId() != 0 ){
            if(null == req.getConsumable()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"是否耗材未选择");
            }
            if(null == ConsumableEnum.getByCode(req.getConsumable())){
                throw new EquipmentException(EquipmentResultCodes.DATA_ILLEGAL);
            }
        }
        SafeMaterialClassifyInfo classifyInfo = new SafeMaterialClassifyInfo();
        classifyInfo.setMaterialClassifyName(req.getMaterialClassifyName());
        classifyInfo.setConsumable(req.getConsumable());
        classifyInfo.setId(req.getId());
        boolean flag = safeMaterialClassifyInfoService.updateById(classifyInfo);
        if (flag){
            resultVO = new ResultVO(ResultCodes.OK);
        }else {
            resultVO = new ResultVO(ResultCodes.SERVER_UPDATE_ERROR);
        }
        return  resultVO;
    }
    @Override
    public ResultVO delete(ContextCacheUser currentUser,Long id) {
        if(id == null){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        SafeMaterialClassifyInfo classify = safeMaterialClassifyInfoService.queryById(id);
        if(null == classify){
            throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST);
        }
        if(0 == classify.getParentId()){//一级
            List<SafeMaterialClassifyInfo> childrenList = safeMaterialClassifyInfoService.getListByParentId(id);
            if (childrenList.size()>0){
                throw new EquipmentException(ResultCodes.SERVER_DEL_ERROR,"改类型存在小类,不可删除!");
            }
        }else {//二级
            //判断是否被绑定
            int count = safeMaterialInfoService.getCountBySmallClassifyId(id);
            if(count > 0){
                throw new EquipmentException(ResultCodes.SERVER_DEL_ERROR,"该类型已被绑定,不可删除!");
            }
        }
        //如果没有被绑定,逻辑删除
        SafeMaterialClassifyInfo classifyInfo = new SafeMaterialClassifyInfo();
        classifyInfo.setId(id);
        classifyInfo.setDelFlag(1);
        safeMaterialClassifyInfoService.updateById(classifyInfo);
        return new ResultVO(ResultCodes.OK);
    }
    @Override
    public SafeMaterialClassifyDto queryById(ContextCacheUser currentUser,Long id) {
        if(id == null){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(id);
        if(null == classifyInfo){
            throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST);
        }
        List<SafeMaterialClassifyInfo> childList = new ArrayList<>();
        if(0l ==  classifyInfo.getParentId()){
            childList = safeMaterialClassifyInfoService.getListByParentId(id);
        }
        SafeMaterialClassifyDto respDTO = new SafeMaterialClassifyDto();
        respDTO.setId(classifyInfo.getId());
        respDTO.setMaterialClassifyName(classifyInfo.getMaterialClassifyName());
        respDTO.setParentId(classifyInfo.getParentId());
        respDTO.setConsumable(classifyInfo.getConsumable());
        respDTO.setConsumableName(ConsumableEnum.getByCode(classifyInfo.getConsumable()).getValue());
        List<SafeMaterialClassifyDto> childDtoList = new ArrayList<>();
        for (SafeMaterialClassifyInfo child:childList){
            SafeMaterialClassifyDto childDto = new SafeMaterialClassifyDto();
            childDto.setId(child.getId());
            childDto.setMaterialClassifyName(child.getMaterialClassifyName());
            childDto.setParentId(child.getParentId());
            childDto.setConsumable(child.getConsumable());
            if(null != child.getConsumable()){
                childDto.setConsumableName(ConsumableEnum.getByCode(child.getConsumable()).getValue());
            }
            childDtoList.add(childDto);
        }
        respDTO.setChildList(childDtoList);
        return respDTO;
    }
    /**
     * 根据小类id获取大小类相关信息
     * @param smallClassifyId
     * @return
     */
    public SafeMaterialClassifyDO getBigAndSmallClassifyInfo(Long smallClassifyId){
        if(null == smallClassifyId){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        SafeMaterialClassifyDO classifyDO = safeMaterialClassifyInfoService.getBigAndSmallClassify(smallClassifyId);
        return classifyDO;
    }
    /**
     * 根据小类ids获取小类相关信息
     * @param ids
     * @return
     */
    public List<SafeMaterialClassifyDto> getClassifyListByIds(List<Long> ids){
        if(CollectionUtils.isEmpty(ids)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        List<SafeMaterialClassifyInfo> list = safeMaterialClassifyInfoService.getClassifyListByIds(ids);
        List<SafeMaterialClassifyDto> classifyDtoList = new ArrayList<>();
        for (SafeMaterialClassifyInfo classifyInfo:list){
            SafeMaterialClassifyDto classifyDto = new SafeMaterialClassifyDto();
            BeanUtils.copyProperties(classifyInfo,classifyDto);
            classifyDtoList.add(classifyDto);
        }
        return classifyDtoList;
    }
    @Override
    public List<SafeMaterialClassifyDO> getTraceabilityClassifyList(List<Long> smallClassifyIds) {
        if(CollectionUtils.isEmpty(smallClassifyIds)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        return safeMaterialClassifyInfoService.getTraceabilityClassifyList(smallClassifyIds);
    }
    @Override
    public SearchResultVO<List<SafeMaterialClassifyDto>> listByPage(ContextCacheUser currentUser,PageQuery<MaterialClassifyQuery> pageQuery) {
        Page<SafeMaterialClassifyInfo> page = new Page<>(pageQuery.getPageIndex(),pageQuery.getPageSize());
        List<SafeMaterialClassifyInfo> parentList = safeMaterialClassifyInfoService.listByPage(page, pageQuery.getSearchParams());
        List<SafeMaterialClassifyInfo> childList = new ArrayList<>();
        if(!CollectionUtils.isEmpty(parentList)){
            List<Long> parentIdList = parentList.stream().map(SafeMaterialClassifyInfo::getId).collect(Collectors.toList());
            childList = safeMaterialClassifyInfoService.getListByParentIds(parentIdList);
        }
        List<SafeMaterialClassifyDto> respList = new ArrayList<>();
        for(SafeMaterialClassifyInfo parentClassify:parentList){
            SafeMaterialClassifyDto classifyDto = new SafeMaterialClassifyDto();
            classifyDto.setId(parentClassify.getId());
            classifyDto.setMaterialClassifyName(parentClassify.getMaterialClassifyName());
            classifyDto.setParentId(parentClassify.getParentId());
            //获取子级
            List<SafeMaterialClassifyInfo> selectList = childList
                    .stream()
                    .filter(cl -> cl.getParentId().equals(parentClassify.getId()))
                    .collect(Collectors.toList());
            List<SafeMaterialClassifyDto> childRespList = new ArrayList<>();
            for(SafeMaterialClassifyInfo child:selectList){
                SafeMaterialClassifyDto childClassify = new SafeMaterialClassifyDto();
                childClassify.setId(child.getId());
                childClassify.setMaterialClassifyName(child.getMaterialClassifyName());
                childClassify.setParentId(child.getParentId());
                childClassify.setConsumable(child.getConsumable());
                if(null != child.getConsumable()){
                    childClassify.setConsumableName(ConsumableEnum.getByCode(child.getConsumable()).getValue());
                }
                childRespList.add(childClassify);
            }
            classifyDto.setChildList(childRespList);
            respList.add(classifyDto);
        }
        return new SearchResultVO<>(true,
                page.getCurrent(),
                page.getSize(),
                page.getPages(),
                page.getTotal(),
                respList,
                ResultCodes.OK);
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/impl/MaterialReceiveRecordsServiceImpl.java
对比新文件
@@ -0,0 +1,219 @@
package com.gkhy.safePlatform.equipment.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.exception.BusinessException;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.entity.*;
import com.gkhy.safePlatform.equipment.enums.*;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsBaseReq;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsQuery;
import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsReq;
import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialReceiveRecordsBaseDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialReceiveRecordsDto;
import com.gkhy.safePlatform.equipment.service.MaterialReceiveRecordsService;
import com.gkhy.safePlatform.equipment.service.baseService.MaterialReceiveRecordsBaseInfoService;
import com.gkhy.safePlatform.equipment.service.baseService.MaterialReceiveRecordsInfoService;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialDetailInfoService;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialInfoService;
import io.micrometer.core.instrument.util.StringUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service
public class MaterialReceiveRecordsServiceImpl implements MaterialReceiveRecordsService {
    @Autowired
    private MaterialReceiveRecordsBaseInfoService recordsBaseInfoService;
    @Autowired
    private MaterialReceiveRecordsInfoService receiveRecordsInfoService;
    @Autowired
    private SafeMaterialDetailInfoService safeMaterialDetailInfoService;
    @Autowired
    private SafeMaterialInfoService safeMaterialInfoService;
    @Autowired
    private RedissonClient redissonClient;
    @Override
    public SearchResultVO<List<MaterialReceiveRecordsBaseDto>> listByPage(ContextCacheUser currentUser, PageQuery<MaterialReceiveRecordsQuery> pageQuery) {
        MaterialReceiveRecordsQuery query = pageQuery.getSearchParams();
        query.setDepId(currentUser.getDepId());
        Page page = new Page<>(pageQuery.getPageIndex(), pageQuery.getPageSize());
        List<MaterialReceiveRecordsBaseDO> list = recordsBaseInfoService.listByPage(page,query);
        List<MaterialReceiveRecordsInfo> receiveRecordsInfoList = new ArrayList<>();
        if(!CollectionUtils.isEmpty(list)) {
            List<Long> idList = list.stream().map(MaterialReceiveRecordsBaseDO::getId).collect(Collectors.toList());
            receiveRecordsInfoList = receiveRecordsInfoService.listByReceiveBaseIds(idList);
        }
        List<MaterialReceiveRecordsBaseDto> receiveRecordsBaseDtoList = new ArrayList<>();
        for(MaterialReceiveRecordsBaseDO receiveRecordsBaseDO:list){
            MaterialReceiveRecordsBaseDto receiveRecordsBaseDto = new MaterialReceiveRecordsBaseDto();
            BeanUtils.copyProperties(receiveRecordsBaseDO,receiveRecordsBaseDto);
            receiveRecordsBaseDto.setStatusName(MaterialReceiveRecordsStatusEnum.getByCode(receiveRecordsBaseDO.getStatus()).getValue());
            //获取该记录关联的物资
            List<MaterialReceiveRecordsInfo> selectList = receiveRecordsInfoList.stream().filter(item -> item.getReceiveBaseId().equals(receiveRecordsBaseDO.getId())).collect(Collectors.toList());
            List<MaterialReceiveRecordsDto> receiveRecordsDtoList = new ArrayList<>();
            for(MaterialReceiveRecordsInfo receiveRecordsInfo:selectList){
                MaterialReceiveRecordsDto receiveRecordsDto = new MaterialReceiveRecordsDto();
                BeanUtils.copyProperties(receiveRecordsInfo,receiveRecordsDto);
                receiveRecordsDto.setMaterialStatusName(MaterialStatusEnum.getByCode(receiveRecordsInfo.getMaterialStatus()).getValue());
                receiveRecordsDto.setRevertStatusName(MaterialRevertStatusEnum.getByCode(receiveRecordsInfo.getRevertStatus()).getValue());
                receiveRecordsDtoList.add(receiveRecordsDto);
            }
            receiveRecordsBaseDto.setMaterialList(receiveRecordsDtoList);
            receiveRecordsBaseDtoList.add(receiveRecordsBaseDto);
        }
        return new SearchResultVO<>(true,
                page.getCurrent(),
                page.getSize(),
                page.getPages(),
                page.getTotal(),
                receiveRecordsBaseDtoList,
                ResultCodes.OK);
    }
    @Override
    @Transactional
    public void revertMaterial(ContextCacheUser currentUser, MaterialReceiveRecordsBaseReq req) {
        //检查
        List<MaterialReceiveRecordsReq> materialList = req.getMaterialList();
        for(MaterialReceiveRecordsReq receiveRecordsReq:materialList){
            if(null == receiveRecordsReq.getReceiveId()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"领取清单主键不可为空!");
            }
            if(null != receiveRecordsReq.getMaterialStatus()){
                if(null == MaterialStatusEnum.getByCode(receiveRecordsReq.getMaterialStatus())){
                    throw new EquipmentException(EquipmentResultCodes.DATA_ILLEGAL,"物资状态不合法!");
                }else{
                    if(MaterialStatusEnum.OTHER.getCode().equals(receiveRecordsReq.getMaterialStatus()) && StringUtils.isBlank(receiveRecordsReq.getRemark())){
                        throw new EquipmentException(EquipmentResultCodes.DATA_ILLEGAL,"损耗备注不可为空!");
                    }
                }
            }
        }
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_REVERT_MATERIAL");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //获取该次领取记录
            MaterialReceiveRecordsBaseInfo receiveRecordsBaseInfo = recordsBaseInfoService.queryById(req.getReceiveBaseId());
            if(null == receiveRecordsBaseInfo){
                throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"该条记录不存在!");
            }
            if(receiveRecordsBaseInfo.getStatus().equals(MaterialReceiveRecordsStatusEnum.CONSUMABLE_RETURN_NO.getCode())){
                throw new EquipmentException(EquipmentResultCodes.MATERIAL_CONSUMABLE);
            }
            List<Long> idList = materialList.stream().map(MaterialReceiveRecordsReq::getReceiveId).collect(Collectors.toList());
            //检查该次要归还的物资是否有归还或处理过
            List<MaterialReceiveRecordsDO> revertList = receiveRecordsInfoService.getNoReturnRecordByIds(idList);
            if(materialList.size() > revertList.size()){
                throw new EquipmentException(EquipmentResultCodes.MATERIAL_IN_THE_LIBRARY,"已归还或已处理物资不可重复归还处理!");
            }
            List<MaterialReceiveRecordsInfo> updateRecordsList = new ArrayList<>();
            List<SafeMaterialDetailInfo> updateDetailList = new ArrayList<>();
            int revertCount = 0;
            int consumeCount = 0;
            int validCount = 0;
            for(MaterialReceiveRecordsReq receiveRecordsReq:materialList){
                //过滤出该条领取物资
                List<MaterialReceiveRecordsDO> selectList = revertList.stream().filter(item -> item.getId().equals(receiveRecordsReq.getReceiveId())).collect(Collectors.toList());
                MaterialReceiveRecordsDO receiveRecord = selectList.get(0);
                //物资清单
                SafeMaterialDetailInfo safeMaterialDetailInfo = new SafeMaterialDetailInfo();
                safeMaterialDetailInfo.setId(receiveRecord.getSmdId());
                safeMaterialDetailInfo.setWareHousingTime(LocalDateTime.now());
                //领取清单
                MaterialReceiveRecordsInfo materialReceiveRecordsInfo = new MaterialReceiveRecordsInfo();
                materialReceiveRecordsInfo.setId(receiveRecordsReq.getReceiveId());
                materialReceiveRecordsInfo.setMaterialStatus(receiveRecordsReq.getMaterialStatus());
                materialReceiveRecordsInfo.setRemark(MaterialStatusEnum.getByCode(receiveRecordsReq.getMaterialStatus()).getValue());
                if(MaterialStatusEnum.INTACT.getCode().equals(receiveRecordsReq.getMaterialStatus()) || null == receiveRecordsReq.getMaterialStatus()){
                    materialReceiveRecordsInfo.setRevertStatus(MaterialRevertStatusEnum.REVERT_YES.getCode());
                    safeMaterialDetailInfo.setIrStatus(IssueReceiptEnum.IN_THE_LIBRARY.getCode());
                    revertCount++;
                    if(receiveRecord.getValidStatus().equals(ValidStatusEnum.NO.getCode())){
                        //无效情况
                        validCount++;
                    }
                }else{
                    //损耗
                    materialReceiveRecordsInfo.setRevertStatus(MaterialRevertStatusEnum.DEPLETION.getCode());
                    if (StringUtils.isNotBlank(receiveRecordsReq.getRemark())) {
                        materialReceiveRecordsInfo.setRemark(receiveRecordsReq.getRemark());
                    }
                    safeMaterialDetailInfo.setIrStatus(IssueReceiptEnum.OUT_OF_LIBRARY.getCode());
                    consumeCount++;
                }
                updateRecordsList.add(materialReceiveRecordsInfo);
                safeMaterialDetailInfo.setStatus(materialReceiveRecordsInfo.getMaterialStatus());
                safeMaterialDetailInfo.setRemark(materialReceiveRecordsInfo.getRemark());
                updateDetailList.add(safeMaterialDetailInfo);
            }
            //物资管理
            SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
            safeMaterialBO.setId(receiveRecordsBaseInfo.getSmId());
            safeMaterialBO.setStockCount(revertCount-validCount);
            //领取总记录
            MaterialReceiveRecordsBaseInfo materialReceiveRecordsBaseInfo = new MaterialReceiveRecordsBaseInfo();
            materialReceiveRecordsBaseInfo.setId(req.getReceiveBaseId());
            if(receiveRecordsBaseInfo.getReceiveCount() == receiveRecordsBaseInfo.getConsumeCount()+materialList.size()){
                materialReceiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.RETURN_COMPLETE.getCode());
            }else{
                materialReceiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.RETURN_PART.getCode());
            }
            materialReceiveRecordsBaseInfo.setRevertCount(receiveRecordsBaseInfo.getRevertCount()+revertCount);
            materialReceiveRecordsBaseInfo.setConsumeCount(receiveRecordsBaseInfo.getConsumeCount()+consumeCount);
            //修改物资管理库存
            safeMaterialInfoService.updateCountById(safeMaterialBO);
            //修改物资清单状态
            safeMaterialDetailInfoService.updateBatchById(updateDetailList);
            //修改总记录
            recordsBaseInfoService.updateById(materialReceiveRecordsBaseInfo);
            //修改领取清单
            receiveRecordsInfoService.updateBatchById(updateRecordsList);
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
    }
    @Override
    public List<MaterialReceiveRecordsDO> getReceiveRecordsByReceiveUids(MaterialReceiveRecordsBO bo){
        if (CollectionUtils.isEmpty(bo.getReceiveUids())) {
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"领取人不可为空!");
        }
        if(CollectionUtils.isEmpty(bo.getSmallClassifyIds())){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"物资类型(小类)不可为空!");
        }
        List<MaterialReceiveRecordsDO> list = receiveRecordsInfoService.getReceiveRecordsByReceiveUids(bo);
        return list;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/impl/SafeMaterialDetailServiceImpl.java
对比新文件
@@ -0,0 +1,1196 @@
package com.gkhy.safePlatform.equipment.service.impl;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountUserService;
import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.UserInfoRPCRespDTO;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.exception.BusinessException;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.utils.StringUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.entity.*;
import com.gkhy.safePlatform.equipment.enums.*;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.model.dto.req.*;
import com.gkhy.safePlatform.equipment.model.dto.req.db.SafeMaterialDetailDBQuery;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialClassifyStockDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialDetailDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeRfidMaterialDetailDto;
import com.gkhy.safePlatform.equipment.service.SafeMaterialDetailService;
import com.gkhy.safePlatform.equipment.service.baseService.*;
import org.apache.dubbo.config.annotation.DubboReference;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service("SafeMaterialDetailService")
public class SafeMaterialDetailServiceImpl implements SafeMaterialDetailService {
    @Autowired
    private SafeMaterialInfoService safeMaterialInfoService;
    @Autowired
    private SafeMaterialDetailInfoService safeMaterialDetailInfoService;
    @Autowired
    private SafeMaterialClassifyInfoService safeMaterialClassifyInfoService;
    @DubboReference(check = false)
    private AccountUserService accountUserService;
    @Autowired
    private RedissonClient redissonClient;
    @Autowired
    private MaterialReceiveRecordsBaseInfoService materialReceiveRecordsBaseInfoService;
    @Autowired
    private MaterialReceiveRecordsInfoService materialReceiveRecordsInfoService;
    @Override
    @Transactional
    public ResultVO save(SafeMaterialDetailAddReq req) {
        //判断物资是否存在
        SafeMaterialDO safeMaterialDO = safeMaterialInfoService.queryById(req.getSmId());
        if(null == safeMaterialDO){
            throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"该种物资不存在!");
        }
        if(null == ValidTypeEnum.getByCode(req.getValidType())){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"有效期类型不合法!");
        }
        if(req.getValidType().equals(ValidTypeEnum.SHORT_TERM.getCode()) && null == req.getValidTime()){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"有效期时间不可为空!");
        }
        //获取数据量
        Integer totalCount = safeMaterialDetailInfoService.getTotalCount();
        List<SafeMaterialDetailInfo> list = new ArrayList<>();
        //RFID起始不为空计算一下
        if(StringUtils.isNotBlank(req.getStartRfid()) && StringUtils.isNotBlank(req.getEndRfid())){
            int start = 0;
            int end = 0;
            String prefix = "";
            try{
                prefix = req.getStartRfid().substring(0,req.getStartRfid().length()-8);
                start = Integer.parseInt(req.getStartRfid().substring(req.getStartRfid().length()-8));
                end = Integer.parseInt(req.getEndRfid().substring(req.getEndRfid().length()-8));
            }catch (Exception e){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"起始RFID不合法!");
            }
            if((end-start+1) != req.getWareHousingCount()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"RFID起始和入库数量不能对应!");
            }
            for(int i = 0;i < req.getWareHousingCount();i++){
                String countStr = String.valueOf(start+i);
                String rfid = "0000000".substring(0,(8 - countStr.length()))+countStr;
                SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo();
                materialDetailInfo.setId(IdUtil.getSnowflake(0,0).nextId());
                materialDetailInfo.setBigClassifyId(safeMaterialDO.getBigClassifyId());
                materialDetailInfo.setSmallClassifyId(safeMaterialDO.getSmallClassifyId());
                materialDetailInfo.setName(safeMaterialDO.getMaterialName());
                materialDetailInfo.setSmId(req.getSmId());
                materialDetailInfo.setConsumable(safeMaterialDO.getConsumable());
                materialDetailInfo.setStatus(MaterialStatusEnum.INTACT.getCode());
                materialDetailInfo.setRemark(MaterialStatusEnum.INTACT.getValue());
                materialDetailInfo.setValidType(req.getValidType());
                if(req.getValidType().equals(ValidTypeEnum.SHORT_TERM.getCode())){
                    materialDetailInfo.setValidTime(req.getValidTime());
                }
                materialDetailInfo.setValidStatus(ValidStatusEnum.YES.getCode());
                materialDetailInfo.setIrStatus(IssueReceiptEnum.IN_THE_LIBRARY.getCode());
                materialDetailInfo.setWareHousingTime(LocalDateTime.now());
                materialDetailInfo.setRfid(prefix+rfid);
                materialDetailInfo.setMaterialNo(generateMaterialNo(totalCount+i));
                list.add(materialDetailInfo);
            }
        }else{
            //不分配FRID
            for(int i = 0;i < req.getWareHousingCount();i++){
                SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo();
                materialDetailInfo.setId(IdUtil.getSnowflake(0,0).nextId());
                materialDetailInfo.setBigClassifyId(safeMaterialDO.getBigClassifyId());
                materialDetailInfo.setSmallClassifyId(safeMaterialDO.getSmallClassifyId());
                materialDetailInfo.setName(safeMaterialDO.getMaterialName());
                materialDetailInfo.setSmId(req.getSmId());
                materialDetailInfo.setConsumable(safeMaterialDO.getConsumable());
                materialDetailInfo.setStatus(MaterialStatusEnum.INTACT.getCode());
                materialDetailInfo.setRemark(MaterialStatusEnum.INTACT.getValue());
                materialDetailInfo.setValidType(req.getValidType());
                if(req.getValidType().equals(ValidTypeEnum.SHORT_TERM.getCode())){
                    materialDetailInfo.setValidTime(req.getValidTime());
                }
                materialDetailInfo.setValidStatus(ValidStatusEnum.YES.getCode());
                materialDetailInfo.setIrStatus(IssueReceiptEnum.IN_THE_LIBRARY.getCode());
                materialDetailInfo.setWareHousingTime(LocalDateTime.now());
                materialDetailInfo.setMaterialNo(generateMaterialNo(totalCount+i));
                list.add(materialDetailInfo);
            }
        }
        //填充物资管理数据
        SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
        safeMaterialBO.setId(req.getSmId());
        safeMaterialBO.setStockCount(req.getWareHousingCount());
        safeMaterialBO.setTotalCount(req.getWareHousingCount());
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_SAVE");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //批量入库
            safeMaterialDetailInfoService.saveBatch(list);
            //修改数量
            safeMaterialInfoService.updateCountById(safeMaterialBO);
            //发送消息
            /*if(req.getValidType().equals(ValidTypeEnum.SHORT_TERM.getCode()) && null != req.getValidTime()){
                for(SafeMaterialDetailInfo materialDetailInfo:list){
                    SafeMaterialMsg safeMaterialMsg = new SafeMaterialMsg();
                    safeMaterialMsg.setId(materialDetailInfo.getId());
                    safeMaterialMsg.setValidTime(conversionTimeType(materialDetailInfo.getValidTime()));
                    rocketMQTemplateHelper.syncSend(safeMaterialTopic,safeMaterialMsg);
                }
            }*/
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return new ResultVO<>(ResultCodes.OK);
    }
    /**
     * 批量入库
     * @param req
     * @return
     */
    @Override
    @Transactional
    public ResultVO saveBatch(SafeMaterialDetailAddReq req) {
        //判断物资是否存在
        SafeMaterialDO safeMaterialDO = safeMaterialInfoService.queryById(req.getSmId());
        if(null == safeMaterialDO){
            throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"该种物资不存在!");
        }
        if(null == ValidTypeEnum.getByCode(req.getValidType())){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"有效期类型不合法!");
        }
        if(req.getValidType().equals(ValidTypeEnum.SHORT_TERM.getCode()) && null == req.getValidTime()){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"有效期时间不可为空!");
        }
        //获取数据量
        Integer totalCount = safeMaterialDetailInfoService.getTotalCount();
        List<SafeMaterialDetailInfo> list = new ArrayList<>();
        for(int i = 0;i < req.getWareHousingCount();i++){
            SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo();
            materialDetailInfo.setId(IdUtil.getSnowflake(0,0).nextId());
            materialDetailInfo.setBigClassifyId(safeMaterialDO.getBigClassifyId());
            materialDetailInfo.setSmallClassifyId(safeMaterialDO.getSmallClassifyId());
            materialDetailInfo.setName(safeMaterialDO.getMaterialName());
            materialDetailInfo.setSmId(req.getSmId());
            materialDetailInfo.setConsumable(safeMaterialDO.getConsumable());
            materialDetailInfo.setStatus(MaterialStatusEnum.INTACT.getCode());
            materialDetailInfo.setRemark(MaterialStatusEnum.INTACT.getValue());
            materialDetailInfo.setValidType(req.getValidType());
            if(req.getValidType().equals(ValidTypeEnum.SHORT_TERM.getCode())){
                materialDetailInfo.setValidTime(req.getValidTime());
            }
            materialDetailInfo.setValidStatus(ValidStatusEnum.YES.getCode());
            materialDetailInfo.setIrStatus(IssueReceiptEnum.IN_THE_LIBRARY.getCode());
            materialDetailInfo.setWareHousingTime(LocalDateTime.now());
            materialDetailInfo.setRfid(req.getRfid());
            materialDetailInfo.setMaterialNo(generateMaterialNo(totalCount+i));
            list.add(materialDetailInfo);
        }
        //填充物资管理数据
        SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
        safeMaterialBO.setId(req.getSmId());
        safeMaterialBO.setStockCount(req.getWareHousingCount());
        safeMaterialBO.setTotalCount(req.getWareHousingCount());
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_SAVEBATCH");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //批量入库
            safeMaterialDetailInfoService.saveBatch(list);
            //修改数量
            safeMaterialInfoService.updateCountById(safeMaterialBO);
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return new ResultVO<>(ResultCodes.OK);
    }
    /**
     * 编辑
     * @param req
     * @return
     */
    @Transactional
    @Override
    public ResultVO update(SafeMaterialDetailReq req) {
        //获取该条数据
        SafeMaterialDetailInfo vo = safeMaterialDetailInfoService.queryById(req.getId());
        if(null == vo){
            throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST);
        }
        //有效类型不为空
        if(null != req.getValidType()){
            if(null == ValidTypeEnum.getByCode(req.getValidType())){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"有效期类型不合法!");
            }else{
                if(req.getValidType().equals(ValidTypeEnum.SHORT_TERM.getCode()) && null == req.getValidTime()){
                    throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"有效期时间不可为空!");
                }else{
                    if(req.getValidTime().before(new Date())){
                        throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"有效期时间小于当前时间!");
                    }
                }
            }
        }
        //填充物资管理数据
        SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
        safeMaterialBO.setId(vo.getSmId());
        safeMaterialBO.setStockCount(0);
        //填充数据
        SafeMaterialDetailInfo safeMaterialDetailInfo = new SafeMaterialDetailInfo();
        safeMaterialDetailInfo.setId(req.getId());
        safeMaterialDetailInfo.setRfid(req.getRfid());
        safeMaterialDetailInfo.setSmId(req.getSmId());
        safeMaterialDetailInfo.setValidType(req.getValidType());
        safeMaterialDetailInfo.setValidTime(req.getValidTime());
        if(ValidStatusEnum.NO.getCode().equals(vo.getValidStatus())){
            //无效情况
            if(vo.getStatus().equals(MaterialStatusEnum.OVERDUE.getCode())){
                //过期
                safeMaterialDetailInfo.setValidStatus(ValidStatusEnum.YES.getCode());
                safeMaterialDetailInfo.setStatus(MaterialStatusEnum.INTACT.getCode());
                safeMaterialDetailInfo.setRemark(MaterialStatusEnum.INTACT.getValue());
                safeMaterialBO.setStockCount(1);
            }
        }
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_UPDATE");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //修改
            safeMaterialDetailInfoService.updateById(safeMaterialDetailInfo);
            if(null != safeMaterialBO){
                safeMaterialInfoService.updateCountById(safeMaterialBO);
            }
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 批量-重新入库
     * @param
     * @return
     */
    @Override
    public ResultVO receiptBatch(ParamForm paramForm) {
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_RECEIPTBATCH");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //验证
            List<SafeMaterialDetailInfo> list = safeMaterialDetailInfoService.getListByIds(paramForm.getIds());
            List<SafeMaterialDetailInfo> selectList = list
                    .stream()
                    .filter(item -> item.getIrStatus().equals(IssueReceiptEnum.OUT_OF_LIBRARY.getCode()) && item.getConsumable().equals(ConsumableEnum.NO.getCode()))
                    .collect(Collectors.toList());
            if(selectList.size() != paramForm.getIds().size()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"已入库或耗材物资不可重复入库!");
            }
            //修改为入库状态
            safeMaterialDetailInfoService.updateReceiptStatusByIds(paramForm.getIds(),IssueReceiptEnum.IN_THE_LIBRARY.getCode());
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 逻辑删除 -批量删除
     * @param
     * @return
     */
    @Transactional
    @Override
    public ResultVO deleteBatch(ContextCacheUser currentUser,ParamForm paramForm) {
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_DELETEBATCH");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //获取所有物资管理
            List<SafeMaterialInfo> safeMaterialInfoList = safeMaterialInfoService.listByDepId(currentUser.getDepId());
            List<Long> idList = paramForm.getIds();
            List<SafeMaterialDetailInfo> list = safeMaterialDetailInfoService.getListByIds(idList);
            List<SafeMaterialDetailInfo> collect = list.stream().filter(item -> item.getIrStatus().equals(IssueReceiptEnum.OUT_OF_LIBRARY.getCode())).collect(Collectors.toList());
            if(collect.size()>0){
                throw new EquipmentException(ResultCodes.SERVER_DEL_ERROR,"出库物资不可删除!");
            }
            List<SafeMaterialBO> safeMaterialBOList = new ArrayList<>();
            for(SafeMaterialInfo materialInfo:safeMaterialInfoList){
                List<SafeMaterialDetailInfo> selectList = list.stream().filter(item -> item.getSmId().equals(materialInfo.getId())).collect(Collectors.toList());
                if(selectList.size()>0){
                    //物资管理
                    SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
                    safeMaterialBO.setId(materialInfo.getId());
                    safeMaterialBO.setStockCount(-selectList.size());
                    safeMaterialBO.setTotalCount(-selectList.size());
                    safeMaterialBOList.add(safeMaterialBO);
                }
            }
            //删除
            safeMaterialDetailInfoService.deleteBatch(paramForm.getIds());
            //修改库存
            safeMaterialInfoService.updateStockCount(safeMaterialBOList);
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 批量出库 - 根据ids
     * @param req
     * @return
     */
    @Transactional
    @Override
    public void deliveryBatchByIds(MterialDeliveryReq req,ContextCacheUser currentUser) {
        //获取认领人信息
        UserInfoRPCRespDTO userInfo = getUserInfo(req.getReceiveUid());
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_DELIVERYBATCHBYIDS");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //验证
            List<SafeMaterialDetailInfo> list = safeMaterialDetailInfoService.getListByIds(req.getIds());
            List<SafeMaterialDetailInfo> selectList = list
                    .stream()
                    .filter(item -> item.getIrStatus().equals(IssueReceiptEnum.IN_THE_LIBRARY.getCode()) && item.getValidStatus().equals(ValidStatusEnum.YES.getCode()))
                    .collect(Collectors.toList());
            if(selectList.size() != req.getIds().size()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"已出库物资或无效物资,不可出库!");
            }
            //获取该部门的所管理物资
            List<SafeMaterialInfo> safeMaterialInfoList = safeMaterialInfoService.listByDepId(currentUser.getDepId());
            List<MaterialReceiveRecordsBaseInfo> receiveRecordsBaseInfoList = new ArrayList<>();
            List<MaterialReceiveRecordsInfo> receiveRecordsInfoList = new ArrayList<>();
            List<SafeMaterialBO> safeMaterialBOList = new ArrayList<>();
            List<SafeMaterialDetailInfo> safeMaterialDetailInfoList = new ArrayList<>();
            //循环
            for(SafeMaterialInfo safeMaterialInfo:safeMaterialInfoList){
                List<SafeMaterialDetailInfo> collectList = list.stream().filter(item -> safeMaterialInfo.getId().equals(item.getSmId())).collect(Collectors.toList());
                if(collectList.size()>0){
                    //物资管理
                    SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
                    safeMaterialBO.setId(safeMaterialInfo.getId());
                    safeMaterialBO.setStockCount(-collectList.size());
                    safeMaterialBOList.add(safeMaterialBO);
                    //总记录
                    MaterialReceiveRecordsBaseInfo receiveRecordsBaseInfo = new MaterialReceiveRecordsBaseInfo();
                    receiveRecordsBaseInfo.setId(IdUtil.getSnowflake(0,0).nextId());
                    receiveRecordsBaseInfo.setMaterialName(safeMaterialInfo.getMaterialName());
                    receiveRecordsBaseInfo.setReceiveUid(userInfo.getUid());
                    receiveRecordsBaseInfo.setReceiveUname(userInfo.getUsername());
                    receiveRecordsBaseInfo.setReceiveCount(collectList.size());
                    receiveRecordsBaseInfo.setRevertCount(0);
                    receiveRecordsBaseInfo.setConsumeCount(0);
                    if(ConsumableEnum.YES.getCode().equals(safeMaterialInfo.getConsumable())){
                        receiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.CONSUMABLE_RETURN_NO.getCode());
                        receiveRecordsBaseInfo.setConsumeCount(0);
                    }else{
                        receiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.RETURN_NO.getCode());
                        receiveRecordsBaseInfo.setConsumeCount(collectList.size());
                    }
                    receiveRecordsBaseInfo.setSmId(safeMaterialInfo.getId());
                    receiveRecordsBaseInfoList.add(receiveRecordsBaseInfo);
                    //循环详细物资
                    for(SafeMaterialDetailInfo safeMaterialDetailInfo:collectList){
                        //领取物资清单记录
                        MaterialReceiveRecordsInfo materialReceiveRecordsInfo = new MaterialReceiveRecordsInfo();
                        materialReceiveRecordsInfo.setId(IdUtil.getSnowflake(0,0).nextId());
                        materialReceiveRecordsInfo.setMaterialName(safeMaterialDetailInfo.getName());
                        materialReceiveRecordsInfo.setMaterialNo(safeMaterialDetailInfo.getMaterialNo());
                        materialReceiveRecordsInfo.setReceiveBaseId(receiveRecordsBaseInfo.getId());
                        if(ConsumableEnum.YES.getCode().equals(safeMaterialDetailInfo.getConsumable())){
                            materialReceiveRecordsInfo.setRevertStatus(MaterialRevertStatusEnum.DEPLETION.getCode());
                            materialReceiveRecordsInfo.setMaterialStatus(MaterialStatusEnum.OTHER.getCode());
                            materialReceiveRecordsInfo.setRemark("耗材");
                        }else{
                            materialReceiveRecordsInfo.setRevertStatus(MaterialRevertStatusEnum.REVERT_NO.getCode());
                            materialReceiveRecordsInfo.setMaterialStatus(MaterialStatusEnum.INTACT.getCode());
                            materialReceiveRecordsInfo.setRemark(MaterialStatusEnum.INTACT.getValue());
                        }
                        materialReceiveRecordsInfo.setReceiveTime(LocalDateTime.now());
                        materialReceiveRecordsInfo.setReceiveUid(userInfo.getUid());
                        materialReceiveRecordsInfo.setReceiveUname(userInfo.getUsername());
                        materialReceiveRecordsInfo.setSmdId(safeMaterialDetailInfo.getId());
                        materialReceiveRecordsInfo.setRfid(safeMaterialDetailInfo.getRfid());
                        receiveRecordsInfoList.add(materialReceiveRecordsInfo);
                        //物资清单
                        SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo();
                        materialDetailInfo.setId(safeMaterialDetailInfo.getId());
                        materialDetailInfo.setReceiveUid(userInfo.getUid());
                        materialDetailInfo.setReceiveUname(userInfo.getRealName());
                        materialDetailInfo.setIrStatus(IssueReceiptEnum.OUT_OF_LIBRARY.getCode());
                        materialDetailInfo.setDeliveryTime(LocalDateTime.now());
                        if(ConsumableEnum.YES.getCode().equals(safeMaterialDetailInfo.getConsumable())){
                            materialDetailInfo.setValidStatus(ValidStatusEnum.NO.getCode());
                            materialDetailInfo.setStatus(MaterialStatusEnum.OTHER.getCode());
                            materialDetailInfo.setRemark("耗材");
                        }
                        safeMaterialDetailInfoList.add(materialDetailInfo);
                    }
                }
            }
            //修改物资管理数量
            safeMaterialInfoService.updateStockCount(safeMaterialBOList);
            //修改物资清单的状态
            safeMaterialDetailInfoService.updateBatchById(safeMaterialDetailInfoList);
            //插入领取总记录
            materialReceiveRecordsBaseInfoService.saveBatch(receiveRecordsBaseInfoList);
            //插入领取清单
            materialReceiveRecordsInfoService.saveBatch(receiveRecordsInfoList);
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
    }
    @Transactional
    @Override
    public void deliveryBatchBySmId(MterialRandomDeliveryReq req,ContextCacheUser currentUser) {
        SafeMaterialDO safeMaterialDO = safeMaterialInfoService.queryById(req.getSmId());
        if(null == safeMaterialDO){
            throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"物资不存在,无法出库!");
        }
        SafeMaterialDetailDBQuery query = new SafeMaterialDetailDBQuery();
        query.setSmId(safeMaterialDO.getId());
        query.setCount(req.getCount());
        query.setRfid(req.getRfid());
        query.setIrStatus(IssueReceiptEnum.IN_THE_LIBRARY.getCode());
        query.setValidStatus(ValidStatusEnum.YES.getCode());
        UserInfoRPCRespDTO userInfo = getUserInfo(req.getReceiveUid());
        List<SafeMaterialDetailInfo> safeMaterialDetailInfoList = new ArrayList<>();
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_DELIVERYBATCHRANDOM");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //获取有效数量
            Integer validStockCount = safeMaterialDetailInfoService.getValidStockCount(req.getSmId());
            if(req.getCount() > validStockCount){
                    throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"出库数量不可大于有效库存数量!");
            }
            if(StringUtils.isNotBlank(req.getRfid())){
                safeMaterialDetailInfoList = safeMaterialDetailInfoService.getListBySmIdAndRfid(query);
            }else{
                safeMaterialDetailInfoList = safeMaterialDetailInfoService.getListBySmId(query);
            }
            if(safeMaterialDetailInfoList.size()< req.getCount()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"库存数量不足!");
            }
            //物资管理
            SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
            safeMaterialBO.setId(req.getSmId());
            safeMaterialBO.setStockCount(-req.getCount());
            //领取记录
            MaterialReceiveRecordsBaseInfo receiveRecordsBaseInfo = new MaterialReceiveRecordsBaseInfo();
            receiveRecordsBaseInfo.setId(IdUtil.getSnowflake(0,0).nextId());
            receiveRecordsBaseInfo.setMaterialName(safeMaterialDO.getMaterialName());
            receiveRecordsBaseInfo.setReceiveUid(userInfo.getUid());
            receiveRecordsBaseInfo.setReceiveUname(userInfo.getUsername());
            receiveRecordsBaseInfo.setReceiveCount(req.getCount());
            receiveRecordsBaseInfo.setRevertCount(0);
            receiveRecordsBaseInfo.setConsumeCount(0);
            if(ConsumableEnum.YES.getCode().equals(safeMaterialDO.getConsumable())){
                receiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.CONSUMABLE_RETURN_NO.getCode());
                receiveRecordsBaseInfo.setConsumeCount(req.getCount());
            }else{
                receiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.RETURN_NO.getCode());
                receiveRecordsBaseInfo.setConsumeCount(0);
            }
            receiveRecordsBaseInfo.setSmId(safeMaterialDO.getId());
            //物资领取清单
            List<MaterialReceiveRecordsInfo> receiveRecordsInfoList = new ArrayList<>();
            //物资清单
            List<SafeMaterialDetailInfo> updateDetailList = new ArrayList<>();
            for(SafeMaterialDetailInfo safeMaterialDetailInfo:safeMaterialDetailInfoList){
                //领取物资清单记录
                MaterialReceiveRecordsInfo materialReceiveRecordsInfo = new MaterialReceiveRecordsInfo();
                materialReceiveRecordsInfo.setId(IdUtil.getSnowflake(0,0).nextId());
                materialReceiveRecordsInfo.setMaterialName(safeMaterialDetailInfo.getName());
                materialReceiveRecordsInfo.setMaterialNo(safeMaterialDetailInfo.getMaterialNo());
                materialReceiveRecordsInfo.setReceiveBaseId(receiveRecordsBaseInfo.getId());
                if(ConsumableEnum.YES.getCode().equals(safeMaterialDetailInfo.getConsumable())){
                    materialReceiveRecordsInfo.setRevertStatus(MaterialRevertStatusEnum.DEPLETION.getCode());
                    materialReceiveRecordsInfo.setMaterialStatus(MaterialStatusEnum.OTHER.getCode());
                    materialReceiveRecordsInfo.setRemark("耗材");
                }else{
                    materialReceiveRecordsInfo.setRevertStatus(MaterialRevertStatusEnum.REVERT_NO.getCode());
                    materialReceiveRecordsInfo.setMaterialStatus(MaterialStatusEnum.INTACT.getCode());
                    materialReceiveRecordsInfo.setRemark(MaterialStatusEnum.INTACT.getValue());
                }
                materialReceiveRecordsInfo.setReceiveTime(LocalDateTime.now());
                materialReceiveRecordsInfo.setReceiveUid(userInfo.getUid());
                materialReceiveRecordsInfo.setReceiveUname(userInfo.getUsername());
                materialReceiveRecordsInfo.setSmdId(safeMaterialDetailInfo.getId());
                materialReceiveRecordsInfo.setRfid(safeMaterialDetailInfo.getRfid());
                receiveRecordsInfoList.add(materialReceiveRecordsInfo);
                //物资清单
                SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo();
                materialDetailInfo.setId(safeMaterialDetailInfo.getId());
                materialDetailInfo.setReceiveUid(userInfo.getUid());
                materialDetailInfo.setReceiveUname(userInfo.getRealName());
                materialDetailInfo.setIrStatus(IssueReceiptEnum.OUT_OF_LIBRARY.getCode());
                materialDetailInfo.setDeliveryTime(LocalDateTime.now());
                if(ConsumableEnum.YES.getCode().equals(safeMaterialDetailInfo.getConsumable())){
                    materialDetailInfo.setValidStatus(ValidStatusEnum.NO.getCode());
                    materialDetailInfo.setStatus(MaterialStatusEnum.OTHER.getCode());
                    materialDetailInfo.setRemark("耗材");
                }
                updateDetailList.add(materialDetailInfo);
            }
            //修改物资清单状态
            safeMaterialDetailInfoService.updateBatchById(updateDetailList);
            //修改物资管理库存
            safeMaterialInfoService.updateCountById(safeMaterialBO);
            //插入领取总记录
            materialReceiveRecordsBaseInfoService.save(receiveRecordsBaseInfo);
            //插入领取清单
            materialReceiveRecordsInfoService.saveBatch(receiveRecordsInfoList);
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
    }
    /**
     * 特殊作业物资出库
     * @param req
     * @return
     */
    @Override
    public void deliveryBatchSpw(MaterialSpwReq req) {
        //验证
        if(null == req.getClaimantId()){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"认领人不可为空!");
        }
        List<MaterialSpwDeliveryReq> deliveryReqList = req.getDeliveryReqList();
        if(CollectionUtils.isEmpty(deliveryReqList)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"出库物资不可为空!");
        }
        //获取小类物资
        List<Long> smallClassifyIds = deliveryReqList
                .stream()
                .map(MaterialSpwDeliveryReq::getSmallClassifyId)
                .collect(Collectors.toList());
        List<Long> depIds = deliveryReqList
                .stream()
                .map(MaterialSpwDeliveryReq::getDepId)
                .collect(Collectors.toList());
        if(smallClassifyIds.size() == 0 || depIds.size() == 0){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"部门/仓库或者物资类型(小类)不可为空!");
        }
        List<SafeMaterialClassifyStockDO> classifyStockList= safeMaterialDetailInfoService.getSmallClassifyStockByIds(smallClassifyIds);
        //根据物资种类获取有效在库物资
        List<SafeMaterialDetailDO> listBySmallClassifyIds = safeMaterialDetailInfoService.getListBySmallClassifyIds(smallClassifyIds,depIds);
        for(MaterialSpwDeliveryReq deliveryReq:deliveryReqList){
            if(null == deliveryReq.getDepId()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"部门或仓库不可为空!");
            }
            if(null == deliveryReq.getCount()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"出库数量不可为空!");
            }
            if(null == deliveryReq.getSmallClassifyId()){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"物资类型(小类)不可为空!");
            }
            List<SafeMaterialClassifyStockDO> collect = classifyStockList
                    .stream()
                    .filter(cs -> cs.getSmallClassifyId().equals(deliveryReq.getSmallClassifyId()) && cs.getDepId().equals(deliveryReq.getDepId())  && cs.getStockCount() >= deliveryReq.getCount())
                    .collect(Collectors.toList());
            if(collect.size() == 0){
                throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL,"库存不足!");
            }
        }
        UserInfoRPCRespDTO userInfo = getUserInfo(req.getClaimantId());
        List<Long> ids = new ArrayList<>();
        //循环数据
        for(MaterialSpwDeliveryReq deliveryReq:deliveryReqList){
            //过滤出rfid存在的数据
            List<SafeMaterialDetailDO> selectRfidNotNull = listBySmallClassifyIds
                    .stream()
                    .filter(item -> null != item.getRfid() && item.getSmallClassifyId().equals(deliveryReq.getSmallClassifyId()) && item.getDepId().equals(deliveryReq.getDepId()))
                    .collect(Collectors.toList());
            List<Long> selectIds = new ArrayList<>();
            if(selectRfidNotNull.size()>0){
                selectIds = selectRfidNotNull
                        .stream()
                        .map(SafeMaterialDetailDO::getId)
                        .collect(Collectors.toList());
            }
            if(selectRfidNotNull.size() >= deliveryReq.getCount()){
                ids.addAll(selectIds.subList(0,deliveryReq.getCount()));
            }else{
                ids.addAll(selectIds);
                List<SafeMaterialDetailDO> selectRfidIsNull = listBySmallClassifyIds
                        .stream()
                        .filter(item -> null == item.getRfid() && item.getSmallClassifyId().equals(deliveryReq.getSmallClassifyId()) && item.getDepId().equals(deliveryReq.getDepId()))
                        .collect(Collectors.toList());
                List<Long> collect = selectRfidIsNull.subList(0,deliveryReq.getCount()-selectRfidNotNull.size()).stream().map(SafeMaterialDetailDO::getId)
                        .collect(Collectors.toList());
                ids.addAll(collect);
            }
        }
        SafeMaterialBatchDeliveryBO detailBO = new SafeMaterialBatchDeliveryBO();
        detailBO.setReceiveUname(userInfo.getUsername());
        detailBO.setReceiveUid(req.getClaimantId());
        detailBO.setIds(ids);
        safeMaterialDetailInfoService.updateDeliveryStatusByIds(detailBO);
    }
    /**
     * 根据rfid获取数据信息
     * @param rfids
     * @return
     */
    @Override
    public List<SafeRfidMaterialDetailDto> getListByRfids(List<String> rfids) {
        if(CollectionUtils.isEmpty(rfids)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        List<SafeMaterialDetailInfoDO> listByRfid = safeMaterialDetailInfoService.getListByRfids(rfids);
        List<SafeRfidMaterialDetailDto> rfidMaterialDetailDtoList = new ArrayList<>();
        for (SafeMaterialDetailInfoDO detailInfoDO:listByRfid){
            SafeRfidMaterialDetailDto detailDto = new SafeRfidMaterialDetailDto();
            detailDto.setId(detailInfoDO.getId());
            detailDto.setName(detailInfoDO.getName());
            detailDto.setBigClassifyId(detailInfoDO.getBigClassifyId());
            detailDto.setSmallClassifyId(detailInfoDO.getSmallClassifyId());
            detailDto.setDepId(detailInfoDO.getDepId());
            rfidMaterialDetailDtoList.add(detailDto);
        }
        return rfidMaterialDetailDtoList;
    }
    @Override
    @Transactional
    public SearchResultVO<List<SafeMaterialDetailDto>> listByPage(ContextCacheUser currentUser,PageQuery<SafeMatetrialDetailQuery> pageQuery) {
        SafeMaterialDetailDBQuery dbQuery = new SafeMaterialDetailDBQuery();
        if(null != pageQuery.getSearchParams()){
            BeanUtils.copyProperties(pageQuery.getSearchParams(),dbQuery);
            dbQuery.setDepId(currentUser.getDepId());
        }
        dbQuery.setDepId(currentUser.getDepId());
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_MATERIALEXPIRED");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //执行无效物资过期
            this.materialExpired();
            //创建成功,释放锁
            lock.unlock();
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        Page<SafeMaterialDetailInfo> page = new Page(pageQuery.getPageIndex(),pageQuery.getPageSize());
        List<SafeMaterialDetailInfoDO> safeMaterialDetailInfoDOS = safeMaterialDetailInfoService.listByPage(page, dbQuery);
        List<SafeMaterialDetailDto> detailDtoList = new ArrayList<>();
        for(SafeMaterialDetailInfoDO materialDetailInfoDO : safeMaterialDetailInfoDOS){
            SafeMaterialDetailDto materialDetailDto = new SafeMaterialDetailDto();
            BeanUtils.copyProperties(materialDetailInfoDO,materialDetailDto);
            materialDetailDto.setConsumableName(ConsumableEnum.getByCode(materialDetailInfoDO.getConsumable()).getValue());
            materialDetailDto.setValidStatusName(ValidStatusEnum.getByCode(materialDetailInfoDO.getValidStatus()).getValue());
            materialDetailDto.setValidTypeName(ValidTypeEnum.getByCode(materialDetailInfoDO.getValidType()).getValue());
            materialDetailDto.setIrStatusName(IssueReceiptEnum.getByCode(materialDetailInfoDO.getIrStatus()).getValue());
            materialDetailDto.setStatusName(MaterialStatusEnum.getByCode(materialDetailInfoDO.getStatus()).getValue());
            detailDtoList.add(materialDetailDto);
        }
        return new SearchResultVO<>(true, page.getCurrent(),page.getSize(), page.getPages(),page.getTotal(),detailDtoList,ResultCodes.OK);
    }
    private void materialExpired(){
        //获取所有物资管理
        List<SafeMaterialInfo> list = safeMaterialInfoService.list();
        //获取在库有效物资
        List<SafeMaterialDetailInfo> unValidList = safeMaterialDetailInfoService.getUnValidList();
        if(unValidList.size()>0){
            List<SafeMaterialBO> safeMaterialBOList = new ArrayList<>();
            List<SafeMaterialDetailInfo> updateValidStatusList = new ArrayList<>();
            for(SafeMaterialInfo safeMaterialInfo:list){
                //过滤出该管理下过期物资
                List<SafeMaterialDetailInfo> expiredList = unValidList.stream().filter(item -> item.getSmId().equals(safeMaterialInfo.getId())).collect(Collectors.toList());
                if(expiredList.size()>0){
                    //过滤非出库无效物资
                    List<SafeMaterialDetailInfo> expiredAndInLibraryList = expiredList.stream().filter(item -> item.getIrStatus().equals(IssueReceiptEnum.IN_THE_LIBRARY.getCode())).collect(Collectors.toList());
                    if(expiredAndInLibraryList.size()>0){
                        //物资管理
                        SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
                        safeMaterialBO.setId(safeMaterialInfo.getId());
                        safeMaterialBO.setStockCount(-expiredAndInLibraryList.size());
                        safeMaterialBOList.add(safeMaterialBO);
                    }
                    //物资清单
                    for(SafeMaterialDetailInfo detailInfo:expiredList){
                        SafeMaterialDetailInfo safeMaterialDetailInfo = new SafeMaterialDetailInfo();
                        safeMaterialDetailInfo.setId(detailInfo.getId());
                        safeMaterialDetailInfo.setValidStatus(ValidStatusEnum.NO.getCode());
                        if(detailInfo.getStatus().equals(MaterialStatusEnum.INTACT.getCode())){
                            safeMaterialDetailInfo.setStatus(MaterialStatusEnum.OVERDUE.getCode());
                            safeMaterialDetailInfo.setRemark(MaterialStatusEnum.OVERDUE.getValue());
                        }
                        updateValidStatusList.add(safeMaterialDetailInfo);
                    }
                }
            }
            if(safeMaterialBOList.size()>0){
                safeMaterialInfoService.updateStockCount(safeMaterialBOList);
            }
            if(updateValidStatusList.size()>0){
                safeMaterialDetailInfoService.updateBatchById(updateValidStatusList);
            }
        }
    }
    @Override
    public ResultVO queryById(Long id) {
        if(null == id){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        SafeMaterialDetailInfo materialDetailInfo = safeMaterialDetailInfoService.queryById(id);
        SafeMaterialDetailDto detailDto = new SafeMaterialDetailDto();
        if(materialDetailInfo != null){
            SafeMaterialDO safeMaterialDO = safeMaterialInfoService.queryById(materialDetailInfo.getSmId());
            SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(materialDetailInfo.getBigClassifyId());
            BeanUtils.copyProperties(materialDetailInfo,detailDto);
            detailDto.setConsumableName(ConsumableEnum.getByCode(materialDetailInfo.getConsumable()).getValue());
            detailDto.setValidStatusName(ValidStatusEnum.getByCode(materialDetailInfo.getValidStatus()).getValue());
            detailDto.setValidTypeName(ValidTypeEnum.getByCode(materialDetailInfo.getValidType()).getValue());
            detailDto.setIrStatusName(IssueReceiptEnum.getByCode(materialDetailInfo.getIrStatus()).getValue());
            detailDto.setStatusName(MaterialStatusEnum.getByCode(materialDetailInfo.getStatus()).getValue());
            if(safeMaterialDO != null){
              detailDto.setDepName(safeMaterialDO.getDepName());
            }
            if(classifyInfo != null){
                detailDto.setBigClassifyName(classifyInfo.getMaterialClassifyName());
            }
        }
        return new ResultVO(ResultCodes.OK,detailDto);
    }
    /**
     * 单条-出库
     * @param req
     * @return
     */
    @Override
    @Transactional
    public void singleDelivery(ContextCacheUser currentUser,SafeMaterialDetailReq req) {
        if(null == req.getReceiveUid()){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL,"领取人不可为空!");
        }
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_SINGLEDELIVERY");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //获取该条数据
            SafeMaterialDetailInfo vo = safeMaterialDetailInfoService.queryById(req.getId());
            if(null == vo){
                throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST);
            }
            if(vo.getValidStatus().equals(ValidStatusEnum.NO.getCode())){
                throw new EquipmentException(EquipmentResultCodes.MATERIAL_INVALID,"无效物资不可出库");
            }
            if(vo.getIrStatus().equals(IssueReceiptEnum.OUT_OF_LIBRARY.getCode())){
                throw new EquipmentException(EquipmentResultCodes.MATERIAL_OUT_OF_LIBRARY);
            }
            //检查认领人
            UserInfoRPCRespDTO userInfo = getUserInfo(req.getReceiveUid());
            //详细物资
            SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo();
            materialDetailInfo.setId(req.getId());
            materialDetailInfo.setIrStatus(IssueReceiptEnum.OUT_OF_LIBRARY.getCode());
            materialDetailInfo.setReceiveUid(req.getReceiveUid());
            materialDetailInfo.setReceiveUname(userInfo.getUsername());
            materialDetailInfo.setDeliveryTime(LocalDateTime.now());
            //物资管理库存数量
            SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
            safeMaterialBO.setId(vo.getSmId());
            safeMaterialBO.setStockCount(-1);
            //出库记录
            MaterialReceiveRecordsBaseInfo receiveRecordsBaseInfo = new MaterialReceiveRecordsBaseInfo();
            receiveRecordsBaseInfo.setId(IdUtil.getSnowflake(0,0).nextId());
            receiveRecordsBaseInfo.setMaterialName(vo.getName());
            receiveRecordsBaseInfo.setReceiveCount(1);
            receiveRecordsBaseInfo.setRevertCount(0);
            receiveRecordsBaseInfo.setConsumeCount(0);
            receiveRecordsBaseInfo.setReceiveUid(userInfo.getUid());
            receiveRecordsBaseInfo.setReceiveUname(userInfo.getUsername());
            receiveRecordsBaseInfo.setSmId(vo.getSmId());
            //出库物资记录
            MaterialReceiveRecordsInfo receiveRecordsInfo = new MaterialReceiveRecordsInfo();
            receiveRecordsInfo.setId(IdUtil.getSnowflake(0,0).nextId());
            receiveRecordsInfo.setMaterialName(vo.getName());
            receiveRecordsInfo.setMaterialNo(vo.getMaterialNo());
            receiveRecordsInfo.setRfid(vo.getRfid());
            receiveRecordsInfo.setReceiveTime(LocalDateTime.now());
            receiveRecordsInfo.setReceiveUid(userInfo.getUid());
            receiveRecordsInfo.setReceiveUname(userInfo.getUsername());
            receiveRecordsInfo.setReceiveBaseId(receiveRecordsBaseInfo.getId());
            receiveRecordsInfo.setSmdId(vo.getId());
            if(vo.getConsumable().equals(ConsumableEnum.YES.getCode())){
                //耗材
                materialDetailInfo.setValidStatus(ValidStatusEnum.NO.getCode());
                materialDetailInfo.setStatus(MaterialStatusEnum.OTHER.getCode());
                materialDetailInfo.setRemark("耗材");
                receiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.CONSUMABLE_RETURN_NO.getCode());
                receiveRecordsInfo.setRevertStatus(MaterialRevertStatusEnum.DEPLETION.getCode());
                receiveRecordsInfo.setMaterialStatus(MaterialStatusEnum.OTHER.getCode());
                receiveRecordsInfo.setRemark("耗材");
            }else{
                //默认未归还
                receiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.RETURN_NO.getCode());
                receiveRecordsInfo.setRevertStatus(MaterialRevertStatusEnum.REVERT_NO.getCode());
                receiveRecordsInfo.setMaterialStatus(MaterialStatusEnum.INTACT.getCode());
                receiveRecordsInfo.setRemark(MaterialStatusEnum.INTACT.getValue());
            }
            //修改出入库状态为出库
            safeMaterialDetailInfoService.updateById(materialDetailInfo);
            //修改物资管理库存
            safeMaterialInfoService.updateCountById(safeMaterialBO);
            //物资领取总记录
            materialReceiveRecordsBaseInfoService.save(receiveRecordsBaseInfo);
            //物资详细清单
            materialReceiveRecordsInfoService.save(receiveRecordsInfo);
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
    }
    /**
     * 单条-重新入库
     * @param id
     * @return
     */
    @Override
    @Transactional
    public void singleReceipt(Long id,ContextCacheUser currentUser) {
        if(null == id){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_SINGLERECEIPT");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //获取该条数据
            SafeMaterialDetailInfo vo = safeMaterialDetailInfoService.queryById(id);
            if(null == vo){
                throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"未查询到该物资出库记录");
            }
            //如果是耗材不可重新入库
            if(vo.getConsumable().equals(ConsumableEnum.YES.getCode())){
                throw new EquipmentException(EquipmentResultCodes.MATERIAL_CONSUMABLE);
            }
            if(vo.getIrStatus().equals(IssueReceiptEnum.IN_THE_LIBRARY.getCode())){
                throw new EquipmentException(EquipmentResultCodes.MATERIAL_IN_THE_LIBRARY);
            }
            //物资管理库存数量
            SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
            safeMaterialBO.setId(vo.getSmId());
            safeMaterialBO.setStockCount(1);
            //获取物资总记录数据
            MaterialDeliveryRecordDO deliveryRecordDO = materialReceiveRecordsInfoService.getRecordBySmdId(id);
            SafeMaterialDetailInfo safeMaterialDetailInfo = new SafeMaterialDetailInfo();
            safeMaterialDetailInfo.setId(vo.getId());
            safeMaterialDetailInfo.setIrStatus(IssueReceiptEnum.IN_THE_LIBRARY.getCode());
            safeMaterialDetailInfo.setWareHousingTime(LocalDateTime.now());
            if(null == deliveryRecordDO){
                //无领取记录
                if (vo.getValidStatus().equals(ValidStatusEnum.NO.getCode())) {//无效
                    if(vo.getStatus().equals(MaterialStatusEnum.OVERDUE.getCode())){//过期
                        safeMaterialBO.setStockCount(0);
                    }else{
                        //其他情况,重新入库则改成有效
                        safeMaterialDetailInfo.setValidStatus(ValidStatusEnum.YES.getCode());
                        safeMaterialDetailInfo.setStatus(MaterialStatusEnum.INTACT.getCode());
                        safeMaterialDetailInfo.setRemark(MaterialStatusEnum.INTACT.getValue());
                    }
                }
            }else{
                //有领取记录,则归还
                //获取未归还物资详细记录
                List<MaterialReceiveRecordsInfo> recordsInfos = materialReceiveRecordsInfoService.getNoReturnRecordByReceiveBaseId(deliveryRecordDO.getReceiveBaseId());
                //领取总记录填充
                MaterialReceiveRecordsBaseInfo receiveRecordsBaseInfo = new MaterialReceiveRecordsBaseInfo();
                receiveRecordsBaseInfo.setId(deliveryRecordDO.getReceiveBaseId());
                if(recordsInfos.size() > 1) {
                    receiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.RETURN_PART.getCode());
                }else {
                    receiveRecordsBaseInfo.setStatus(MaterialReceiveRecordsStatusEnum.RETURN_COMPLETE.getCode());
                }
                receiveRecordsBaseInfo.setRevertCount(deliveryRecordDO.getRevertCount()+1);
                materialReceiveRecordsBaseInfoService.updateById(receiveRecordsBaseInfo);
                //详细物资领取记录
                MaterialReceiveRecordsInfo receiveRecordsInfo = new MaterialReceiveRecordsInfo();
                receiveRecordsInfo.setId(deliveryRecordDO.getReceiveId());
                receiveRecordsInfo.setRevertStatus(MaterialRevertStatusEnum.REVERT_YES.getCode());
                receiveRecordsInfo.setRevertTime(LocalDateTime.now());
                receiveRecordsInfo.setMaterialStatus(MaterialStatusEnum.INTACT.getCode());
                receiveRecordsInfo.setRemark(MaterialStatusEnum.INTACT.getValue());
                materialReceiveRecordsInfoService.updateById(receiveRecordsInfo);
            }
            //修改出入库状态为入库
            safeMaterialDetailInfoService.updateById(safeMaterialDetailInfo);
            //修改物资管理库存
            safeMaterialInfoService.updateCountById(safeMaterialBO);
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
    }
    /**
     * 逻辑删除 -单条
     * @param
     * @return
     */
    @Transactional
    @Override
    public ResultVO delete(Long id){
        if(null == id){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SMD_DELETE");
        try {
            //获取该条数据
            SafeMaterialDetailInfo vo = safeMaterialDetailInfoService.queryById(id);
            if(null == vo){
                throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST);
            }
            if(vo.getIrStatus().equals(IssueReceiptEnum.OUT_OF_LIBRARY.getCode())){
                throw new EquipmentException(ResultCodes.SERVER_DEL_ERROR,"出库物资不可删除!");
            }
            SafeMaterialDetailInfo materialDetailInfo = new SafeMaterialDetailInfo();
            materialDetailInfo.setId(id);
            materialDetailInfo.setDelFlag(1);
            //物资管理库存数量
            SafeMaterialBO safeMaterialBO = new SafeMaterialBO();
            safeMaterialBO.setId(vo.getSmId());
            if(vo.getValidStatus().equals(ValidStatusEnum.YES.getCode())){
                //有效
                safeMaterialBO.setStockCount(-1);
                safeMaterialBO.setTotalCount(-1);
            }else{
                //无效
                safeMaterialBO.setTotalCount(-1);
            }
            //删除一条数据
            safeMaterialDetailInfoService.updateById(materialDetailInfo);
            //减少库存
            safeMaterialInfoService.updateCountById(safeMaterialBO);
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return new ResultVO<>(ResultCodes.OK);
    }
    /**
     * 根据小类id(物资种类)获取库存数量
     * @param smallClassifyIds
     * @return
     */
    public List<SafeMaterialClassifyStockDto> getSmallClassifyStockByIds(List<Long> smallClassifyIds) {
        if(CollectionUtils.isEmpty(smallClassifyIds)){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        List<SafeMaterialClassifyStockDO> classifyStockList= safeMaterialDetailInfoService.getSmallClassifyStockByIds(smallClassifyIds);
        List<SafeMaterialClassifyStockDto> classifyStockDtoList = new ArrayList<>();
        for (SafeMaterialClassifyStockDO classifyStockDO:classifyStockList){
            SafeMaterialClassifyStockDto classifyStockDto = new SafeMaterialClassifyStockDto();
            BeanUtils.copyProperties(classifyStockDO,classifyStockDto);
            classifyStockDtoList.add(classifyStockDto);
        }
        return classifyStockDtoList;
    }
    private UserInfoRPCRespDTO getUserInfo(Long uid) {
        UserInfoRPCRespDTO userInfo = new UserInfoRPCRespDTO();
        ResultVO<UserInfoRPCRespDTO> rpcResult = accountUserService.getUserInfoByUid(uid);
        if (rpcResult != null && rpcResult.getCode().equals(ResultCodes.OK.getCode())) {
            if (rpcResult.getData() != null) {
                userInfo = (UserInfoRPCRespDTO) rpcResult.getData();
            }else {
                throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"领取人员不存在!");
            }
        } else {
            throw new EquipmentException(ResultCodes.RPC_RESULT_NULL);
        }
        return userInfo;
    }
    private String generateMaterialNo(int count){
        if(count < 0){
            return null;
        }
        String serialCode = null;
        String prefix = "NO-";
        if(count >= 10000){
            serialCode = "" + (count+1);
        }else if(count >=0){
            String countStr = String.valueOf(count+1);
            serialCode = "10000".substring(0,(5 - countStr.length()))+countStr;
        }
        serialCode = prefix + serialCode;
        return serialCode;
    }
    private Date conversionTimeType(LocalDateTime localDateTime){
        ZoneId zoneId = ZoneId.systemDefault();
        ZonedDateTime zdt = localDateTime.atZone(zoneId);
        Date date = Date.from(zdt.toInstant());
        return date;
    }
}
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/service/impl/SafeMaterialServiceImpl.java
对比新文件
@@ -0,0 +1,397 @@
package com.gkhy.safePlatform.equipment.service.impl;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService;
import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepInfoRPCRespDTO;
import com.gkhy.safePlatform.account.rpc.apimodel.model.resp.DepRPCRespDTO;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.exception.BusinessException;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
import com.gkhy.safePlatform.equipment.entity.*;
import com.gkhy.safePlatform.equipment.enums.ConsumableEnum;
import com.gkhy.safePlatform.equipment.enums.EquipmentResultCodes;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.equipment.model.dto.req.ParamForm;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialAddReq;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialModReq;
import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialQuery;
import com.gkhy.safePlatform.equipment.model.dto.resp.BaseMaterialDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialClassificationDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialDepartmentDto;
import com.gkhy.safePlatform.equipment.model.dto.resp.SafeMaterialDto;
import com.gkhy.safePlatform.equipment.service.SafeMaterialService;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialClassifyInfoService;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialDetailInfoService;
import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialInfoService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.ibatis.annotations.Param;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service("SafeMaterialService")
public class SafeMaterialServiceImpl implements SafeMaterialService {
    @Autowired
    private SafeMaterialInfoService safeMaterialInfoService;
    @DubboReference(check = false)
    private AccountDepartmentService accountDepartmentService;
    @Autowired
    private SafeMaterialClassifyInfoService safeMaterialClassifyInfoService;
    @Autowired
    private SafeMaterialDetailInfoService safeMaterialDetailInfoService;
    @Autowired
    private RedissonClient redissonClient;
    @Override
    public ResultVO save(ContextCacheUser currentUser,SafeMaterialAddReq req) {
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SM_INSERT");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //获取物资类型
            SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(req.getSmallClassifyId());
            if(null == classifyInfo){
                throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"物资类型不存在!");
            }
            //判断该部门是否已经创建物资
            boolean flag = safeMaterialInfoService.checkMaterial(req.getSmallClassifyId(), currentUser.getDepId(), null);
            if(flag){
                throw new EquipmentException(EquipmentResultCodes.DATA_EXIST,"该种物资已存在不可重复创建");
            }
            //获取数量
            int safeMaterialTotalCount = safeMaterialInfoService.getTotalCount();
            SafeMaterialInfo safeMaterialInfo = new SafeMaterialInfo();
            safeMaterialInfo.setId(IdUtil.getSnowflake(0,0).nextId());
            safeMaterialInfo.setConsumable(classifyInfo.getConsumable());
            safeMaterialInfo.setDepId(currentUser.getDepId());
            safeMaterialInfo.setSmallClassifyId(req.getSmallClassifyId());
            safeMaterialInfo.setMaterialName(classifyInfo.getMaterialClassifyName());
            safeMaterialInfo.setDepName(currentUser.getDepName());
            safeMaterialInfo.setSerialNum(this.generateSerialNum(safeMaterialTotalCount));
            safeMaterialInfo.setBigClassifyId(req.getBigClassifyId());
            safeMaterialInfo.setTotalCount(0);
            safeMaterialInfo.setStockCount(0);
            //插入
            safeMaterialInfoService.save(safeMaterialInfo);
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return new ResultVO(ResultCodes.OK);
    }
    @Override
    public ResultVO update(ContextCacheUser currentUser,SafeMaterialModReq req) {
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SM_UPDATE");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //获取物资类型
            SafeMaterialClassifyInfo classifyInfo = safeMaterialClassifyInfoService.queryById(req.getSmallClassifyId());
            if(null == classifyInfo){
                throw new EquipmentException(EquipmentResultCodes.DATA_NOT_EXIST,"物资类型不存在!");
            }
            boolean flag = safeMaterialInfoService.checkMaterial(req.getSmallClassifyId(), currentUser.getDepId(), req.getId());
            if(flag){
                throw new EquipmentException(EquipmentResultCodes.DATA_EXIST,"该种物资已存在不可重复创建");
            }
            SafeMaterialInfo safeMaterialInfo = new SafeMaterialInfo();
            safeMaterialInfo.setConsumable(classifyInfo.getConsumable());
            safeMaterialInfo.setSmallClassifyId(req.getSmallClassifyId());
            safeMaterialInfo.setMaterialName(classifyInfo.getMaterialClassifyName());
            safeMaterialInfo.setDepName(currentUser.getDepName());
            safeMaterialInfo.setBigClassifyId(req.getBigClassifyId());
            safeMaterialInfo.setId(req.getId());
            //跟新
            safeMaterialInfoService.updateById(safeMaterialInfo);
        //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return new ResultVO(ResultCodes.OK);
    }
    @Override
    public ResultVO queryById(ContextCacheUser currentUser,Long id) {
        if(null == id){
            throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL);
        }
        SafeMaterialDO safeMaterialDO = safeMaterialInfoService.queryById(id);
        SafeMaterialDto safeMaterialDto = new SafeMaterialDto();
        if(null != safeMaterialDO){
            BeanUtils.copyProperties(safeMaterialDO,safeMaterialDto);
            if(null != ConsumableEnum.getByCode(safeMaterialDO.getConsumable())){
                safeMaterialDto.setConsumableName(ConsumableEnum.getByCode(safeMaterialDO.getConsumable()).getValue());
            }
        }
        return new ResultVO(ResultCodes.OK,safeMaterialDto);
    }
    public ResultVO delete(ContextCacheUser currentUser,Long id) {
        ResultVO resultVO = null;
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SM_DELETE");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            //删除之前检查详表中是否还有该物物资数据
            int count = safeMaterialDetailInfoService.getCountBySmId(id);
            if(count > 0){
                throw new EquipmentException(EquipmentResultCodes.DATA_HAS_BEEN_BOND,"该种物资已被绑定物资详情数据,不可删除!");
            }
            SafeMaterialInfo materialInfo = new SafeMaterialInfo();
            materialInfo.setId(id);
            materialInfo.setDelFlag(1);
            boolean flag = safeMaterialInfoService.updateById(materialInfo);
            if(flag){
                resultVO = new ResultVO(ResultCodes.OK);
            }else{
                resultVO = new ResultVO(ResultCodes.SERVER_DEL_ERROR);
            }
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return resultVO;
    }
    @Override
    public ResultVO deleteBatch(ContextCacheUser currentUser, ParamForm paramForm) {
        //加分布式锁,防止重复创建规则
        RLock lock = redissonClient.getLock("LOCK_SM_DELETEBATCH");
        try {
            lock.lock(10, TimeUnit.SECONDS);
            int count = safeMaterialDetailInfoService.getCountBySmIds(paramForm.getIds());
            //判断是否绑定具体安全物资数据
            if(count > 0){
                throw new EquipmentException(EquipmentResultCodes.DATA_HAS_BEEN_BOND,"物资已被绑定物资详情数据,不可删除!");
            }
            safeMaterialInfoService.deleteBatch(paramForm.getIds());
            //创建成功,释放锁
            lock.unlock();
        }catch (EquipmentException e) {
            e.printStackTrace();
            throw new EquipmentException(e.getCode(), e.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(ResultCodes.SERVER_ERROR);
        }finally {
            if(lock.isLocked()){
                lock.unlock();
            }
        }
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 获取列表
     * @return
     */
    @Override
    public List<MaterialClassificationDto> listByDepId(ContextCacheUser currentUser) {
        //获取所有数据
        List<SafeMaterialInfo> materialInfoList = safeMaterialInfoService.listByDepId(currentUser.getDepId());
        //获取所有物资类型
        List<SafeMaterialClassifyInfo> classifyInfoList = safeMaterialClassifyInfoService.getParentList();
        List<MaterialClassificationDto> classificationDtoList = new ArrayList<>();
        for (SafeMaterialClassifyInfo classifyInfo:classifyInfoList) {
            MaterialClassificationDto classificationDto = new MaterialClassificationDto();
            classificationDto.setMaterialClassifyName(classifyInfo.getMaterialClassifyName());
            classificationDto.setMaterialClassifyId(classifyInfo.getId());
            //过滤出物资数据
            List<SafeMaterialInfo> selectMaterialList = materialInfoList
                    .stream()
                    .filter(item -> classifyInfo.getId().equals(item.getBigClassifyId()))
                    .collect(Collectors.toList());
            List<BaseMaterialDto> baseMaterialDtoList = new ArrayList<>();
            if(selectMaterialList.size()>0){
                //循环物资
                for (SafeMaterialInfo materialInfo:selectMaterialList){
                    //填充基础物资数据
                    BaseMaterialDto baseMaterialDto = new BaseMaterialDto();
                    baseMaterialDto.setMaterialName(materialInfo.getMaterialName());
                    baseMaterialDto.setSmId(materialInfo.getId());
                    baseMaterialDto.setMaterialName(materialInfo.getMaterialName());
                    baseMaterialDto.setConsumable(materialInfo.getConsumable());
                    baseMaterialDto.setConsumableName(ConsumableEnum.getByCode(materialInfo.getConsumable()).getValue());
                    baseMaterialDtoList.add(baseMaterialDto);
                }
                classificationDto.setBaseMaterialList(baseMaterialDtoList);
                classificationDtoList.add(classificationDto);
            }
        }
        return classificationDtoList;
    }
    @Override
    public List<MaterialDepartmentDto> list(ContextCacheUser currentUser) {
        //获取所有数据
        List<SafeMaterialInfo> materialInfoList = safeMaterialInfoService.list();
        //获取所有部门
        List<DepRPCRespDTO> depInfoList = getDepInfoList();
        //获取所有物资类型
        List<SafeMaterialClassifyInfo> classifyInfoList = safeMaterialClassifyInfoService.getParentList();
        //循环部门
        List<MaterialDepartmentDto> departmentDtoList = new ArrayList<>();
        recursiveDep(depInfoList,departmentDtoList,materialInfoList,classifyInfoList);
        return departmentDtoList;
    }
    private void recursiveDep(List<DepRPCRespDTO> depInfoList,List<MaterialDepartmentDto> departmentDtoList,List<SafeMaterialInfo> materialInfoList,List<SafeMaterialClassifyInfo> classifyInfoList){
        for (DepRPCRespDTO dep:depInfoList){
            MaterialDepartmentDto materialDepartmentDto = new MaterialDepartmentDto();
            materialDepartmentDto.setDepId(dep.getDepId());
            materialDepartmentDto.setDepName(dep.getDepName());
            List<MaterialClassificationDto> classificationDtoList = new ArrayList<>();
            for (SafeMaterialClassifyInfo classifyInfo:classifyInfoList) {
                MaterialClassificationDto classificationDto = new MaterialClassificationDto();
                classificationDto.setMaterialClassifyName(classifyInfo.getMaterialClassifyName());
                classificationDto.setMaterialClassifyId(classifyInfo.getId());
                //过滤出物资数据
                List<SafeMaterialInfo> selectMaterialList = materialInfoList
                        .stream()
                        .filter(item -> classifyInfo.getId().equals(item.getBigClassifyId()) && dep.getDepId().equals(item.getDepId()))
                        .collect(Collectors.toList());
                List<BaseMaterialDto> baseMaterialDtoList = new ArrayList<>();
                if(selectMaterialList.size()>0){
                    //循环物资
                    for (SafeMaterialInfo materialInfo:selectMaterialList){
                        //填充基础物资数据
                        BaseMaterialDto baseMaterialDto = new BaseMaterialDto();
                        baseMaterialDto.setMaterialName(materialInfo.getMaterialName());
                        baseMaterialDto.setSmId(materialInfo.getId());
                        baseMaterialDtoList.add(baseMaterialDto);
                    }
                    classificationDto.setBaseMaterialList(baseMaterialDtoList);
                    classificationDtoList.add(classificationDto);
                }
            }
            if(classificationDtoList.size()>0){
                materialDepartmentDto.setClassificationList(classificationDtoList);
                departmentDtoList.add(materialDepartmentDto);
            }
            //子集部门
            if(!CollectionUtils.isEmpty(dep.getChildren())){
                this.recursiveDep(dep.getChildren(),departmentDtoList,materialInfoList,classifyInfoList);
            }
        }
    }
    @Override
    public SearchResultVO<List<SafeMaterialDto>> listByPage(ContextCacheUser currentUser,PageQuery<SafeMaterialQuery> pageQuery) {
        Page<SafeMaterialDO> page= new Page(pageQuery.getPageIndex(),pageQuery.getPageSize());
        SafeMaterialQuery query = pageQuery.getSearchParams();
        query.setDepId(currentUser.getDepId());
        List<SafeMaterialDO> materialInfoList = safeMaterialInfoService.listByPage(page, query);
        List<SafeMaterialDto> materialDtoList = new ArrayList<>();
        for (SafeMaterialDO materialDO:materialInfoList){
            SafeMaterialDto materialDto = new SafeMaterialDto();
            BeanUtils.copyProperties(materialDO,materialDto);
            if(null != ConsumableEnum.getByCode(materialDO.getConsumable())){
                materialDto.setConsumableName(ConsumableEnum.getByCode(materialDO.getConsumable()).getValue());
            }
            materialDtoList.add(materialDto);
        }
        return new SearchResultVO<>(
                true,
                page.getCurrent(),
                page.getSize(),
                page.getPages(),
                page.getTotal(),
                materialDtoList,ResultCodes.OK);
    }
    private DepInfoRPCRespDTO getDepInfoByDepId(Long deptId) {
        DepInfoRPCRespDTO dep = new DepInfoRPCRespDTO();
        ResultVO<DepInfoRPCRespDTO> rpcResult = accountDepartmentService.getDepInfoByDepId(deptId);
        if (rpcResult != null && rpcResult.getCode().equals(ResultCodes.OK.getCode())) {
            if (rpcResult.getData() != null) {
                dep = (DepInfoRPCRespDTO) rpcResult.getData();
            }else {
                throw new EquipmentException(ResultCodes.CLIENT_DEP_NOT_EXIST);
            }
        } else {
            throw new EquipmentException(ResultCodes.RPC_RESULT_NULL);
        }
        return dep;
    }
    private List<DepRPCRespDTO> getDepInfoList() {
        List<DepRPCRespDTO> depInfoList = new ArrayList<>();
        ResultVO<List<DepRPCRespDTO>> rpcResult = accountDepartmentService.depList();
        if (rpcResult != null && rpcResult.getCode().equals(ResultCodes.OK.getCode())) {
            if (rpcResult.getData() != null) {
                depInfoList = (List<DepRPCRespDTO>) rpcResult.getData();
            }else{
                throw new EquipmentException(ResultCodes.CLIENT_DEP_NOT_EXIST);
            }
        } else {
            throw new EquipmentException(ResultCodes.CLIENT_DEP_NOT_EXIST);
        }
        return depInfoList;
    }
    private String generateSerialNum(int count){
        if(count < 0){
            return null;
        }
        String code = null;
        String prefix = "ID-";
        String serialCode = null;
        if(count >= 10000){
            serialCode = "" + (count+1);
        }else if(count >=0){
            String countStr = String.valueOf(count+1);
            serialCode = "00000".substring(0,(5 - countStr.length()))+countStr;
        }
        if(serialCode != null && !serialCode.isEmpty()){
            code = prefix+serialCode;
        }
        return code;
    }
}
equipment/equipment-service/src/main/resources/config/mapper/equipment/MaterialReceiveRecordsBaseInfoMapper.xml
对比新文件
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.safePlatform.equipment.repository.MaterialReceiveRecordsBaseInfoRepository">
    <resultMap type="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseInfo" id="resultMap">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="material_name" property="materialName" jdbcType="VARCHAR"/>
        <result column="receive_uid" property="receiveId" jdbcType="BIGINT"/>
        <result column="receive_uname" property="receiveName" jdbcType="VARCHAR"/>
        <result column="receive_count" property="receiveCount" jdbcType="INTEGER"/>
        <result column="revert_count" property="revertCount" jdbcType="INTEGER"/>
        <result column="consume_count" property="consumeCount" jdbcType="INTEGER"/>
        <result column="status" property="status" jdbcType="TINYINT"/>
        <result column="remark" property="remark" jdbcType="VARCHAR"/>
        <result column="sm_id" property="smId" jdbcType="BIGINT"/>
        <result column="del_flag" property="delFlag" jdbcType="INTEGER"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="create_uid" property="createUid" jdbcType="BIGINT"/>
        <result column="create_uname" property="createUname" jdbcType="VARCHAR"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="update_uid" property="updateUid" jdbcType="BIGINT"/>
        <result column="update_uname" property="updateUname" jdbcType="VARCHAR"/>
    </resultMap>
    <select id="listByConditions" resultType="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseDO">
        SELECT b.id,
               b.material_name,
               b.receive_uid,
               b.receive_uname,
               b.receive_count,
               b.revert_count,
               b.consume_count,
               b.status,
               b.remark,
               b.create_time,
               b.sm_id,
               s.dep_id,
               s.dep_name
               from material_receive_records_base b
                inner join safe_material s on b.sm_id = s.id
                where b.del_flag = 0
                <if test="query.materialName != null and query.materialName != '' ">
                    and instr(b.material_name,#{query.materialName})>0
                </if>
                <if test="query.receiveUname != null and query.receiveUname != '' ">
                    and instr(b.receive_uname,#{query.receiveUname})>0
                </if>
                <if test="query.depId != null">
                    and s.dep_id = #{query.depId}
                </if>
                <if test="query.startTime != null ">
                    and DATE_FORMAT(b.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{query.startTime},'%Y-%m-%d')
                </if>
                <if test="query.endTime != null ">
                    and DATE_FORMAT(b.create_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{query.endTime},'%Y-%m-%d')
                </if>
                order by b.create_time desc
    </select>
</mapper>
equipment/equipment-service/src/main/resources/config/mapper/equipment/MaterialReceiveRecordsInfoMapper.xml
对比新文件
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.safePlatform.equipment.repository.MaterialReceiveRecordsInfoRepository">
    <resultMap type="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsInfo" id="resultMap">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="material_name" property="materialName" jdbcType="VARCHAR"/>
        <result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
        <result column="rfid" property="rfid" jdbcType="VARCHAR"/>
        <result column="revert_status" property="revertStatus" jdbcType="TINYINT"/>
        <result column="material_status" property="materialStatus" jdbcType="TINYINT"/>
        <result column="smd_id" property="smdId" jdbcType="BIGINT"/>
        <result column="receive_uid" property="receiveUid" jdbcType="BIGINT"/>
        <result column="receive_uname" property="receiveUname" jdbcType="VARCHAR"/>
        <result column="receive_time" property="receiveTime" jdbcType="TIMESTAMP"/>
        <result column="receive_base_id" property="receiveBaseId" jdbcType="BIGINT"/>
        <result column="remark" property="remark" jdbcType="VARCHAR"/>
        <result column="revert_time" property="revertTime" jdbcType="TIMESTAMP"/>
    </resultMap>
    <select id="getRecordBySmdId" resultType="com.gkhy.safePlatform.equipment.entity.MaterialDeliveryRecordDO">
        select
            r.id as receiveId,
            r.material_name,
            r.rfid,
            r.smd_id,
            b.id as receiveBaseId,
            b.revert_count,
            b.receive_count,
            b.receive_uid,
            b.status,
            b.receive_uname,
            b.create_time as receiveTime
        from material_receive_records r
        inner join material_receive_records_base b
        on r.receive_base_id = b.id
        where r.smd_id = #{smdId}
        and r.revert_status = #{revertStatus}
    </select>
    <select id="getNoReturnRecordByIds" resultType="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsDO">
        SELECT
            r.id ,
            r.material_name,
            r.rfid,
            r.smd_id,
            r.material_status,
            r.revert_status,
            r.receive_uid,
            r.receive_uname,
            r.receive_time,
            r.remark,
            r.revert_time,
            s.valid_status
        FROM
            material_receive_records r
                INNER JOIN safe_material_detail s ON r.smd_id = s.id
        WHERE
            r.id in
            <foreach collection="idList" item="id" open="(" close=")" separator=",">
                #{id}
            </foreach>
          and r.revert_status = #{revertStatus}
    </select>
    <select id="getReceiveRecordsByReceiveUids" resultType="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsDO">
        SELECT
            r.id,
            r.material_no,
            r.material_name,
            r.rfid,
            r.receive_uid,
            r.receive_uname,
            r.smd_id,
            d.small_classify_id,
            d.big_classify_id,
            d.consumable,
            c.material_classify_name as bigClassifyName
        FROM
            material_receive_records r
                LEFT JOIN safe_material_detail d ON r.smd_id = d.id
            LEFT JOIN safe_material_classify c on d.big_classify_id = c.id
        where r.revert_status = 1 and r.receive_uid in
        <foreach collection="receiveUids" item="receiveUid" separator="," open="(" close=")">
            #{receiveUid}
        </foreach>
         and d.small_classify_id in
        <foreach collection="smallClassifyIds" item="smallClassifyId" separator="," open="(" close=")">
            #{smallClassifyId}
        </foreach>
    </select>
</mapper>
equipment/equipment-service/src/main/resources/config/mapper/equipment/SafeMaterialClassifyInfoMapper.xml
对比新文件
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.safePlatform.equipment.repository.SafeMaterialClassifyInfoRepository">
    <!--新增-->
    <insert id="save" parameterType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo">
        insert into safe_material_classify (id,material_classify_name,parent_id,consumable,del_flag,create_time,create_uid,create_uname,update_time,update_uid,update_uname) values (#{id},#{materialClassifyName},#{parentId},#{consumable},#{delFlag},#{createTime},#{createUid},#{createUname},#{updateTime},#{updateUid},#{updateUname})
    </insert>
    <!--更新-->
    <update id="update" parameterType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo">
        update safe_material_classify
        <trim prefix="SET" suffixOverrides=",">
            <if test="materialClassifyName != null and materialClassifyName != ''">
                material_classify_name = #{materialClassifyName}
            </if>
        </trim>
        where id = #{id}
    </update>
    <!--逻辑删除-->
    <update id="delete">
        update safe_material_classify set del_fag = 1 where id = #{id}
    </update>
    <!--查询单条数据-->
    <select id="queryById" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo">
        select id,material_classify_name,parent_id,consumable,create_time,create_uid,create_uname,update_time,update_uid,update_uname from safe_material_classify where id = #{id} and del_flag = 0;
    </select>
    <select id="listByContion" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo">
        select id,
               material_classify_name
        from safe_material_classify
        where del_flag = 0
        <if test="mateialClassifyName != null and materialClassifyName != ''">
           and instr(material_classify_name,#{materialClassifyName}) > 0
        </if>
    </select>
    <select id="getListByParentId" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo">
        select id,material_classify_name,parent_id from safe_material_classify where parent_id = #{parentId} and del_flag = 0;
    </select>
    <select id="getBigAndSmallClassify" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO">
        SELECT
            c1.id as smallClassifyId,
            c1.material_classify_name as smallClassifyName,
            c2.id as bigClassifyId,
            c2.material_classify_name as bigClassifyName
        FROM
            safe_material_classify c1
                INNER JOIN safe_material_classify c2 ON c1.parent_id = c2.id
        WHERE
            c1.del_flag = 0
          AND c1.id = #{smallClassifyId}
    </select>
    <select id="getTraceabilityClassifyList" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyDO">
        SELECT
            c1.id as smallClassifyId,
            c1.material_classify_name as smallClassifyName,
            c2.id as bigClassifyId,
            c2.material_classify_name as bigClassifyName
        FROM
            safe_material_classify c1
                INNER JOIN safe_material_classify c2 ON c1.parent_id = c2.id
        WHERE
            c1.del_flag = 0
          AND c1.id in
              <foreach collection="smallClassifyIds" item="id" close=")" open="(" separator=",">
                  #{id}
              </foreach>
    </select>
    <select id="listByConditions" parameterType="com.gkhy.safePlatform.equipment.model.dto.req.MaterialClassifyQuery" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo">
        SELECT
            id,
            parent_id,
            material_classify_name,
            consumable
        FROM
            safe_material_classify
        WHERE del_flag = 0
            and parent_id = 0
        <if test="query.classifyName != null and query.classifyName != ''">
            and instr(material_classify_name,#{query.classifyName}) > 0
        </if>
    </select>
    <select id="getListByParentIds" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyInfo">
        SELECT
        id,
        parent_id,
        material_classify_name,
        consumable
        FROM
        safe_material_classify
        WHERE
        del_flag = 0
        and parent_id in
        <foreach collection="parentIdList" item="parentId" open="(" close=")" separator=",">
            #{parentId}
        </foreach>
    </select>
</mapper>
equipment/equipment-service/src/main/resources/config/mapper/equipment/SafeMaterialDetailInfoMapper.xml
对比新文件
@@ -0,0 +1,359 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.safePlatform.equipment.repository.SafeMaterialDetailInfoRepository">
    <resultMap type="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfo" id="materialDetailResult">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="name" property="name" jdbcType="VARCHAR"/>
        <result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
        <result column="big_classify_id" property="bigClassifyId" jdbcType="BIGINT"/>
        <result column="small_classify_id" property="smallClassifyId" jdbcType="BIGINT"/>
        <result column="rfid" property="rfid" jdbcType="VARCHAR"/>
        <result column="consumable" property="consumable" jdbcType="TINYINT"/>
        <result column="valid_type" property="validType" jdbcType="TINYINT"/>
        <result column="valid_time" property="validTime" jdbcType="TIMESTAMP"/>
        <result column="valid_status" property="validStatus" jdbcType="TINYINT"/>
        <result column="status" property="status" jdbcType="TINYINT"/>
        <result column="ir_status" property="irStatus" jdbcType="TINYINT"/>
        <result column="ware_housing_time" property="wareHousingTime" jdbcType="TIMESTAMP"/>
        <result column="delivery_time" property="deliveryTime" jdbcType="TIMESTAMP"/>
        <result column="sm_id" property="smId" jdbcType="BIGINT"/>
        <result column="receive_uid" property="receiveUid" jdbcType="BIGINT"/>
        <result column="receive_uname" property="receiveUname" jdbcType="VARCHAR"/>
        <result column="remark" property="remark" jdbcType="VARCHAR"/>
        <result column="del_flag" property="delFlag" jdbcType="INTEGER"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="create_uid" property="createUid" jdbcType="BIGINT"/>
        <result column="create_uname" property="createUname" jdbcType="VARCHAR"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="update_uid" property="updateUid" jdbcType="BIGINT"/>
        <result column="update_uname" property="updateUname" jdbcType="VARCHAR"/>
    </resultMap>
    <select id="getTotalCount" resultType="java.lang.Integer">
        select count(1) from safe_material_detail
    </select>
    <select id="queryById" resultMap="materialDetailResult">
        select id,
               name,
               material_no,
               big_classify_id,
               rfid,
               consumable,
               valid_type,
               valid_time,
               valid_status,
               status,
               ir_status,
               ware_housing_time,
               delivery_time,
               sm_id,
               receive_uid,
               receive_uname
        from safe_material_detail where del_flag = 0 and id = #{id}
    </select>
    <update id="updateReceiptStatus" >
        update safe_material_detail
        set ir_status = #{status},
            ware_housing_time = #{wareHousingTime},
            receive_uid = null,
            receive_uname = null,
            delivery_time = null
        where id = #{id}
    </update>
    <select id="getListByIds" resultMap="materialDetailResult">
        select id,name,material_no,big_classify_id,rfid,consumable,valid_type,valid_time,valid_status,status,ir_status,ware_housing_time,ware_housing_time,delivery_time,sm_id,receive_uid,
        receive_uname,remark
               from safe_material_detail
               where del_flag = 0
                 and id in
                <foreach collection="ids" item="id" separator="," open="(" close=")">
                    #{id}
                </foreach>
    </select>
    <update id="updateReceiptStatusByIds" >
        update safe_material_detail
        set ir_status = #{irStatus},
            ware_housing_time = #{wareHousingTime},
            receive_uid = null,
            receive_uname = null,
            delivery_time = null
            where id in
        <foreach collection="ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
    </update>
    <select id="getCountGroupBySmId" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailCountDO">
        select smId,count(*)
        from safe_material_detail
        where del_flag = 0
          and ir_status = #{irStatus}
          and id in
        <foreach collection="ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
        group by smId
    </select>
    <select id="getStatisticsValidStock" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailCountDO">
        select count(1) as count,
               sm_id
        from safe_material_detail
        where del_flag = 0
            and valid_status = #{validStatus}
            and ir_status = #{irStatus}
            and sm_id in
            <foreach collection="smIds" item="smId" open="(" close=")" separator=",">
                #{smId}
            </foreach>
        GROUP BY
            sm_id
    </select>
    <!--批量删除-->
    <update id="deleteBatch">
        update safe_material_detail set del_flag = 1 where id in
        <foreach collection="ids" item="id" open="(" close=")" separator=",">
            #{id}
        </foreach>
    </update>
    <!--批量出库-根据ids-->
    <update id="updateDeliveryStatusByIds" >
        update safe_material_detail
        set ir_status = #{detailBO.irStatus},
            receive_uid = #{detailBO.receiveUid},
            receive_uname = #{detailBO.receiveUname},
            delivery_time = #{detailBO.deliveryTime}
        where id in
        <foreach collection="detailBO.ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
    </update>
    <select id="getValidStockCount" resultType="java.lang.Integer">
      select count(1)
      from safe_material_detail
      where del_flag = 0
        and valid_status = #{validStatus}
        and ir_status = #{irStatus}
        and sm_id = #{smId}
    </select>
    <select id="listByCondition" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfoDO">
        select sd.id,
               CONCAT(sd.name,'(',sm.serial_num,')') as name,
               sd.material_no,
               sd.big_classify_id,
               sd.rfid,
               sd.consumable,
               sd.valid_type,
               sd.valid_time,
               sd.valid_status,
               sd.status,
               sd.remark,
               sd.ir_status,
               sd.ware_housing_time,
               sd.receive_uname,
               sd.delivery_time,
               sm.dep_id,
               sm.dep_name,
               sd.sm_id,
               sc.material_classify_name as bigClassifyName
        from safe_material_detail sd
                 INNER JOIN safe_material_classify sc on sd.big_classify_id = sc.id
                 INNER JOIN safe_material sm on sd.sm_id = sm.id
        where sd.del_flag = 0
        <if test="query.rfid != null and query.rfid != '' ">
            and sd.rfid = #{query.rfid}
        </if>
        <if test="query.irStatus != null">
            and sd.ir_status = #{query.irStatus}
        </if>
        <if test="query.smId != null">
            and sd.sm_id = #{query.smId}
        </if>
        <if test="query.depId != null">
            and sm.dep_id = #{query.depId}
        </if>
        ORDER BY sd.create_time desc
    </select>
    <!--根据smId统计数量-->
    <select id="getCountBySmId" resultType="java.lang.Integer">
        select count(1) from safe_material_detail where del_flag = 0 and sm_id = #{smId}
    </select>
    <!--根据smIds统计数量-->
    <select id="getCountBySmIds" resultType="java.lang.Integer">
        select count(1) from safe_material_detail where del_flag = 0 and sm_id in
        <foreach collection="smIds" item="smId" open="(" close=")" separator=",">
            #{smId}
        </foreach>
    </select>
    <update id="updateValidStatus" >
        update safe_material_detail set valid_status = #{validStatus} where id = #{id}
    </update>
    <select id="getRfidNotNullList" resultType="java.lang.Long">
        select id from safe_material_detail where sm_id = #{smId} and ir_status = 0 and valid_status = 0 and del_flag = 0 and rfid is not null ORDER BY ware_housing_time asc LIMIT #{count}
    </select>
    <select id="getRfidNullList" resultType="java.lang.Long">
        select id from safe_material_detail where sm_id = #{smId} and ir_status = 0 and valid_status = 0 and del_flag = 0 and rfid is null ORDER BY ware_housing_time asc LIMIT #{count}
    </select>
    <select id="getListBySmIdAndRfid" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfo">
        select id,
               name,
               material_no,
               big_classify_id,
               rfid,
               consumable,
               valid_type,
               valid_time,
               valid_status,
               status,
               ir_status,
               ware_housing_time,
               delivery_time,
               sm_id,
               receive_uid,
               receive_uname
        from safe_material_detail where del_flag = 0 and sm_id = #{query.smId} and ir_status = #{query.irStatus} and valid_status = #{query.validStatus} and rfid = #{query.rfid} ORDER BY create_time asc LIMIT #{query.count}
    </select>
    <select id="getListBySmId" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfo">
        select id,
               name,
               material_no,
               big_classify_id,
               rfid,
               consumable,
               valid_type,
               valid_time,
               valid_status,
               status,
               ir_status,
               ware_housing_time,
               delivery_time,
               sm_id,
               receive_uid,
               receive_uname
        from safe_material_detail where del_flag = 0 and sm_id = #{query.smId} and ir_status = #{query.irStatus} and valid_status = #{query.validStatus} ORDER BY create_time asc LIMIT #{query.count}
    </select>
    <select id="getSmallClassifyStockByIds" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialClassifyStockDO">
        select d.small_classify_id,
        m.dep_id,
        m.dep_name,
        count(1) as stockCount
        from safe_material_detail d
        INNER JOIN safe_material m
        ON d.sm_id = m.id
        where d.del_flag = 0
        and d.ir_status = 0
        and d.valid_status = 0
        and d.small_classify_id in
        <foreach collection="smallClassifyIds" item="smallClassifyId" separator="," open="(" close=")">
            #{smallClassifyId}
        </foreach>
        group By d.small_classify_id,m.dep_id,m.dep_name
    </select>
    <select id="getListBySmallClassifyIds" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailDO">
        SELECT
        sd.id,
        sd.rfid,
        sm.dep_id,
        sd.small_classify_id,
        sd.big_classify_id
        FROM
        safe_material_detail sd
        INNER JOIN safe_material sm ON sd.sm_id = sm.id
        WHERE
        sd.del_flag = 0
        AND sd.ir_status = 0
        AND sd.valid_status = 0
        AND sd.small_classify_id IN
        <foreach collection="smallClassifyIds" item="smallClassifyId" open="(" close=")" separator=",">
            #{smallClassifyId}
        </foreach>
        AND sm.dep_id IN
        <foreach collection="depIds" item="depId" open="(" close=")" separator=",">
            #{depId}
        </foreach>
        ORDER BY
        sd.create_time ASC
    </select>
    <select id="getListByRfids" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfoDO">
        SELECT
            sd.id,
            CONCAT( sd.NAME, '(NO', sd.material_no, ')' ) as name,
            sd.big_classify_id,
            sd.small_classify_id,
            sm.dep_id
        FROM
            safe_material_detail sd
        inner join safe_material sm on sd.sm_id = sm.id
        WHERE
            sd.del_flag = 0
          AND sd.ir_status = 1
          AND sd.rfid in
        <foreach collection="rfids" item="rfid" open="(" close=")" separator=",">
            #{rfid}
        </foreach>
    </select>
    <select id="updateValidStatusByIds" >
        update safe_material_detail set valid_status = #{validStatus} where id in
        <foreach collection="ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
    </select>
    <select id="getUnValidList" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfo">
        select
            id,
            name,
            material_no,
            big_classify_id,
            rfid,
            consumable,
            valid_type,
            valid_time,
            valid_status,
            ir_status,
            ware_housing_time,
            ware_housing_time,
            delivery_time,
            sm_id,
            receive_uid,
            receive_uname
        from safe_material_detail
        where del_flag = 0
            and valid_status = #{validStatus}
            and  DATE_FORMAT(valid_time,'%Y%m%d') &lt; DATE_FORMAT(CURDATE( ),'%Y%m%d')
    </select>
    <update id="updateBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
            update safe_material_detail
            <trim prefix="SET" suffixOverrides=",">
                <if test="null != item.receiveUid">
                    receive_uid = #{item.receiveUid},
                </if>
                <if test="null != item.receiveUname and '' != item.receiveUname">
                    receive_uname = #{item.receiveUname},
                </if>
                <if test="null != item.irStatus">
                    ir_status = #{item.irStatus},
                </if>
                <if test="null != item.deliveryTime">
                    delivery_time = #{item.deliveryTime}
                </if>
                <if test="null != item.validStatus">
                    valid_status = #{item.validStatus}
                </if>
                <if test="null != item.remark and '' != item.remark">
                    remark = #{item.remark}
                </if>
                <if test="null != item.status">
                    status = #{item.status}
                </if>
            </trim>
            where id = #{item.id}
        </foreach>
    </update>
</mapper>
equipment/equipment-service/src/main/resources/config/mapper/equipment/SafeMaterialInfoMapper.xml
对比新文件
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.safePlatform.equipment.repository.SafeMaterialInfoRepository">
    <resultMap type="com.gkhy.safePlatform.equipment.entity.SafeMaterialInfo" id="materialResult">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="serial_num" property="serialNum" jdbcType="VARCHAR"/>
        <result column="big_classify_id" property="bigClassifyId" jdbcType="BIGINT"/>
        <result column="small_classify_id" property="smallClassifyId" jdbcType="BIGINT"/>
        <result column="dep_id" property="depId" jdbcType="BIGINT"/>
        <result column="dep_name" property="depName" jdbcType="VARCHAR"/>
        <result column="material_name" property="materilaName" jdbcType="VARCHAR"/>
        <result column="consumable" property="consumable" jdbcType="TINYINT"/>
        <result column="total_count" property="totalCount" jdbcType="INTEGER"/>
        <result column="stock_count" property="stockCount" jdbcType="INTEGER"/>
        <result column="del_flag" property="delFlag" jdbcType="INTEGER"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="create_uid" property="createUid" jdbcType="BIGINT"/>
        <result column="create_uname" property="createUname" jdbcType="VARCHAR"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="update_uid" property="updateUid" jdbcType="BIGINT"/>
        <result column="update_uname" property="updateUname" jdbcType="VARCHAR"/>
    </resultMap>
    <!--查询单条数据-->
    <select id="queryById" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDO">
        select m.id,
               m.serial_num,
               m.big_classify_id as bigClassifyId,
               m.small_classify_id as smallClassifyId,
               m.dep_id,
               m.dep_name,
               m.material_name,
               m.consumable,
               m.stock_count,
               m.total_count,
               m.create_time,
               m.material_name as smallClassifyName,
               c.material_classify_name as bigClassifyName
        from safe_material m
        inner join safe_material_classify c
        on m.big_classify_id = c.id
        where m.del_flag = 0
        and m.id = #{id};
    </select>
    <!--查询所有数量-->
    <select id="getTotalCount" resultType="java.lang.Integer">
        select count(1) from safe_material;
    </select>
    <!--根据小类型统计数量-->
    <select id="getCountBySmallClassifyId" resultType="java.lang.Integer">
        select count(1) from safe_material where del_flag = 0 and small_classify_id = #{smallClassifyId}
    </select>
    <update id="deleteBatch">
        update safe_material set del_flag = 1 where id in
        <foreach collection="ids" item="id" separator="," open="(" close=")" >
            #{id}
        </foreach>
    </update>
    <!--条件查询-->
    <select id="listByConditions" resultType="com.gkhy.safePlatform.equipment.entity.SafeMaterialDO">
        select m.id,
               m.serial_num,
               m.big_classify_id as bigClassifyId,
               m.small_classify_id as smallClassifyId,
               m.dep_id,
               m.dep_name,
               m.material_name,
               m.consumable,
               m.stock_count,
               m.total_count,
               m.create_time,
               m.material_name as smallClassifyName,
               c.material_classify_name as bigClassifyName
        from safe_material m
        inner join safe_material_classify c
        on m.big_classify_id = c.id
        where m.del_flag = 0
        <if test="query.materialName != null and query.materialName != '' ">
            and instr(m.material_name,#{query.materialName})>0
        </if>
        <if test="query.bigClassifyId != null">
            and m.big_classify_id = #{query.bigClassifyId}
        </if>
        <if test="query.depId != null">
            and m.dep_id = #{query.depId}
        </if>
        order by m.create_time desc
    </select>
    <select id="checkMatrial" resultType="java.lang.Integer">
        select count(1)
        from safe_material
        where del_flag = 0
        and small_classify_id = #{smallClassifyId}
        and dep_id = #{depId}
        <if test="id != null">
            and id != #{id}
        </if>
    </select>
    <update id="updateCountById">
        update safe_material
        <trim prefix="SET" suffixOverrides=",">
            <if test="totalCount != null">
                total_count = total_count + #{totalCount},
            </if>
            <if test="stockCount != null">
                stock_count = stock_count + #{stockCount},
            </if>
        </trim>
        where id = #{id}
    </update>
    <update id="updateStockCount">
        <foreach collection="safeMaterialBOList" item="safeMaterialBO" separator=";">
            update safe_material
            <trim prefix="SET" suffixOverrides=",">
                <if test="safeMaterialBO.totalCount != null">
                    total_count = total_count + #{safeMaterialBO.totalCount},
                </if>
                <if test="safeMaterialBO.stockCount != null">
                    stock_count = stock_count + #{safeMaterialBO.stockCount}
                </if>
            </trim>
            where id = #{safeMaterialBO.id}
        </foreach>
    </update>
</mapper>
pom.xml
@@ -31,9 +31,9 @@
        <project.build.sourceencoding>UTF-8</project.build.sourceencoding>
        <project.reporting.outputencoding>UTF-8</project.reporting.outputencoding>
        <java.version>1.8</java.version>
        <dubbo.version>3.0.8</dubbo.version>
        <nacos.client.version>2.1.0</nacos.client.version>
        <minio.version>8.4.2</minio.version>
        <dubbo.version>3.1.2</dubbo.version>
        <nacos.client.version>2.1.2</nacos.client.version>
        <minio.version>8.4.5</minio.version>
        <okhttp.version>4.10.0</okhttp.version>
        <fastjson.version>1.2.47</fastjson.version>
        <mysql.connector.version>8.0.29</mysql.connector.version>
@@ -42,10 +42,11 @@
        <account.rpc.model.version>1.0-SNAPSHOT</account.rpc.model.version>
        <mybatis.plus.version>3.5.2</mybatis.plus.version>
        <poi.version>4.1.2</poi.version>
        <com.alibaba.cloud.version>2.2.8.RELEASE</com.alibaba.cloud.version>
        <jta.starter.version>2.7.1</jta.starter.version>
        <com.alibaba.cloud.version>2.2.9.RELEASE</com.alibaba.cloud.version>
        <jta.starter.version>2.7.5</jta.starter.version>
        <commons.utils.version>1.9.4</commons.utils.version>
        <redission.version>3.17.4</redission.version>
        <redission.version>3.18.0</redission.version>
        <rocketmq.starter.version>2.2.2</rocketmq.starter.version>
    </properties>
    <dependencyManagement>
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/database/MyBatisConfigEquipment.java
@@ -2,8 +2,10 @@
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.gkhy.safePlatform.equipment.handler.MyMetaObjectHandler;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
@@ -63,6 +65,11 @@
        //设置分页插件
        Interceptor[] plugins = {mybatisPlusInterceptor};
        factoryBean.setPlugins(plugins);
        GlobalConfig globalConfig = new GlobalConfig();
        globalConfig.setMetaObjectHandler(new MyMetaObjectHandler());
        factoryBean.setGlobalConfig(globalConfig);
        return factoryBean.getObject();
    }
safePlatfrom-out-web/src/main/java/com/gkhy/safePlatform/config/exception/GlobalExceptionHandler.java
@@ -6,12 +6,14 @@
import com.gkhy.safePlatform.commons.exception.BusinessException;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.emergency.excepiton.EmergencyException;
import com.gkhy.safePlatform.equipment.excepiton.EquipmentException;
import com.gkhy.safePlatform.incidentManage.exception.AccidentException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -38,6 +40,15 @@
    @ResponseBody
    @ExceptionHandler(value = EmergencyException.class)
    public ResultVO AHandler(EmergencyException e) {
        logger.warn(e.getMessage());
        return new ResultVO(e.getCode(),e.getMessage());
    }
    /**
     * 设备自定义异常
     */
    @ResponseBody
    @ExceptionHandler(value = EquipmentException.class)
    public ResultVO AHandler(EquipmentException e) {
        logger.warn(e.getMessage());
        return new ResultVO(e.getCode(),e.getMessage());
    }
@@ -115,4 +126,15 @@
        return resultVO;
//        return new ResultVO(ResultCodes.SERVER_ERROR);
    }
    /**
     * 处理入参异常
     * @param e
     * @return
     */
    @ResponseBody
    @ExceptionHandler(MethodArgumentNotValidException.class)
    public ResultVO handleMethodArgumentNotValidException(MethodArgumentNotValidException e){
        logger.warn(e.getBindingResult().getFieldError().getDefaultMessage());
        return new ResultVO(ResultCodes.SERVER_PARAM_NULL.getCode(),e.getBindingResult().getFieldError().getDefaultMessage());
    }
}
safePlatfrom-out-web/src/main/resources/config/application-dev.yaml
@@ -74,6 +74,10 @@
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  global-config:
    db-config:
      logic-delete-value: 1
      logic-not-delete-value: 0
dubbo:
  registry:
@@ -112,8 +116,11 @@
    sendMessageTimeout: 300000
  consumer:
    group: gkhy-safeplatform-out-dev
    safeMaterialGroup: gkhy-safeplatform-out-safeMaterialConsumer
  topic:
    demoTopic: gkhy-safeplatform-topic-demo
    safeMaterialTopic: gkhy-safeplatform-out-safeMaterialTopic
minio:
  endPoint: 192.168.0.52
safePlatfrom-out-web/src/main/resources/config/application-guotai-demo.yaml
@@ -2,7 +2,7 @@
  tomcat:
    uri-encoding: UTF-8
    basedir: /
  port: 16009
  port: 16012
  servlet:
    context-path: /
@@ -14,31 +14,31 @@
    type: com.alibaba.druid.pool.xa.DruidXADataSource
    emergency:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.emergency.guotai?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.emergency.guotai.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      username: gkhy_safeplatform_guotai_out
      password: a7687@i8a1Sdd
      type: com.alibaba.druid.pool.DruidDataSource
    goalmanage:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.goalmanage.guotai?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.goalmanage.guotai.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      username: gkhy_safeplatform_guotai_out
      password: a7687@i8a1Sdd
      type: com.alibaba.druid.pool.DruidDataSource
    incidentmanage:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.incidentmanage.guotai?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.incidentmanage.guotai.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      username: gkhy_safeplatform_guotai_out
      password: a7687@i8a1Sdd
      type: com.alibaba.druid.pool.DruidDataSource
    equipment:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.equipment.guotai?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.equipment.guotai.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      username: gkhy_safeplatform_guotai_out
      password: a7687@i8a1Sdd
      type: com.alibaba.druid.pool.DruidDataSource
  redis:
    host: 192.168.30.107
    port: 6376
    port: 6375
    password: SEF98uvs98dUAUEF90Udssa
    database: 0           # Redis 数据库号,默认为 0
    timeout: 15000        # Redis 连接超时时间,单位:毫秒。
@@ -57,14 +57,14 @@
    nacos:
      discovery:
        server-addr: http://192.168.30.107:8848
        namespace: 8e59b946-36d6-4d29-81f1-27a55951b86e
        namespace: 78fe80cc-6159-4381-8e42-1cc6c68eb22e
        username: gkhy_dev_out_team
        password: 9485uyJHISes09t
        enabled: true
        register-enabled: true
      config:
        server-addr: http://192.168.30.107:8848
        namespace: 8e59b946-36d6-4d29-81f1-27a55951b86e
        namespace: 78fe80cc-6159-4381-8e42-1cc6c68eb22e
        username: gkhy_dev_out_team
        password: 9485uyJHISes09t
    inetutils:
@@ -83,7 +83,7 @@
dubbo:
  registry:
    protocol: nacos
    address: nacos://192.168.30.107:8848?namespace=8e59b946-36d6-4d29-81f1-27a55951b86e&username=gkhy_dev_out_team&password=9485uyJHISes09t
    address: nacos://192.168.30.107:8848?namespace=78fe80cc-6159-4381-8e42-1cc6c68eb22e&username=gkhy_dev_out_team&password=9485uyJHISes09t
  application:
    name: gkhy-safeplatform-out
  scan:
@@ -91,7 +91,7 @@
    base-packages: com.gkhy.safePlatform
  protocol:
    name: dubbo
    port: 18083
    port: 18089
    serialization: kryo
    host: ${spring.cloud.client.ip-address}
  consumer:
@@ -112,12 +112,12 @@
rocketmq:
  name-server: 192.168.30.107:9876
  producer:
    group: gkhy-safeplatform-guotai
    group: gkhy-safeplatform-guotai-uat
    sendMessageTimeout: 300000
  consumer:
    group: gkhy-safeplatform-guotai
    group: gkhy-safeplatform-guotai-uat
  topic:
    demoTopic: gkhy-safeplatform-topic-demo
    demoTopic: gkhy-safeplatform-topic-demo-uat
minio:
  endPoint: 121.239.169.27
@@ -125,7 +125,7 @@
  accessKey: QR0J7S55SZO8QI1TC2AD
  secretKey: X0oSBT7vRqYWU41Ut21B+FU7G5A87BzPIRdObGjK
  secure: false
  bucketName: safeplatform-demo
  bucketName: safeplatform-guotai-uat
  urlPrefix: http://121.239.169.27/file
  #用户名 gkhy_team_out_dev
  #密码 12345678
safePlatfrom-out-web/src/main/resources/config/application-online-uat.yaml
文件名从 safePlatfrom-out-web/src/main/resources/config/application-guotai-uat.yaml 修改
@@ -2,7 +2,7 @@
  tomcat:
    uri-encoding: UTF-8
    basedir: /
  port: 16012
  port: 16009
  servlet:
    context-path: /
@@ -14,31 +14,31 @@
    type: com.alibaba.druid.pool.xa.DruidXADataSource
    emergency:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.emergency.guotai.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.emergency.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      username: gkhy_safeplatform_guotai_out
      password: a7687@i8a1Sdd
      type: com.alibaba.druid.pool.DruidDataSource
    goalmanage:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.goalmanage.guotai.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.goalmanage.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      username: gkhy_safeplatform_guotai_out
      password: a7687@i8a1Sdd
      type: com.alibaba.druid.pool.DruidDataSource
    incidentmanage:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.incidentmanage.guotai.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.incidentmanage.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      username: gkhy_safeplatform_guotai_out
      password: a7687@i8a1Sdd
      type: com.alibaba.druid.pool.DruidDataSource
    equipment:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.equipment.guotai.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      url: jdbc:mysql://192.168.30.107:43306/safeplatform.equipment.uat?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
      username: gkhy_safeplatform_guotai_out
      password: a7687@i8a1Sdd
      type: com.alibaba.druid.pool.DruidDataSource
  redis:
    host: 192.168.30.107
    port: 6375
    port: 6376
    password: SEF98uvs98dUAUEF90Udssa
    database: 0           # Redis 数据库号,默认为 0
    timeout: 15000        # Redis 连接超时时间,单位:毫秒。
@@ -57,14 +57,14 @@
    nacos:
      discovery:
        server-addr: http://192.168.30.107:8848
        namespace: 78fe80cc-6159-4381-8e42-1cc6c68eb22e
        namespace: 8e59b946-36d6-4d29-81f1-27a55951b86e
        username: gkhy_dev_out_team
        password: 9485uyJHISes09t
        enabled: true
        register-enabled: true
      config:
        server-addr: http://192.168.30.107:8848
        namespace: 78fe80cc-6159-4381-8e42-1cc6c68eb22e
        namespace: 8e59b946-36d6-4d29-81f1-27a55951b86e
        username: gkhy_dev_out_team
        password: 9485uyJHISes09t
    inetutils:
@@ -83,7 +83,7 @@
dubbo:
  registry:
    protocol: nacos
    address: nacos://192.168.30.107:8848?namespace=78fe80cc-6159-4381-8e42-1cc6c68eb22e&username=gkhy_dev_out_team&password=9485uyJHISes09t
    address: nacos://192.168.30.107:8848?namespace=8e59b946-36d6-4d29-81f1-27a55951b86e&username=gkhy_dev_out_team&password=9485uyJHISes09t
  application:
    name: gkhy-safeplatform-out
  scan:
@@ -91,7 +91,7 @@
    base-packages: com.gkhy.safePlatform
  protocol:
    name: dubbo
    port: 18089
    port: 18083
    serialization: kryo
    host: ${spring.cloud.client.ip-address}
  consumer:
@@ -112,12 +112,12 @@
rocketmq:
  name-server: 192.168.30.107:9876
  producer:
    group: gkhy-safeplatform-guotai-uat
    group: gkhy-safeplatform-guotai
    sendMessageTimeout: 300000
  consumer:
    group: gkhy-safeplatform-guotai-uat
    group: gkhy-safeplatform-guotai
  topic:
    demoTopic: gkhy-safeplatform-topic-demo-uat
    demoTopic: gkhy-safeplatform-topic-demo
minio:
  endPoint: 121.239.169.27
@@ -125,7 +125,7 @@
  accessKey: QR0J7S55SZO8QI1TC2AD
  secretKey: X0oSBT7vRqYWU41Ut21B+FU7G5A87BzPIRdObGjK
  secure: false
  bucketName: safeplatform-guotai-uat
  bucketName: safeplatform-demo
  urlPrefix: http://121.239.169.27/file
  #用户名 gkhy_team_out_dev
  #密码 12345678
safePlatfrom-out-web/src/main/resources/config/application.yaml
@@ -2,11 +2,14 @@
  application:
    name: safeplatform-out
  profiles:
    active: dev
#    active: guotai-demo
#### test  uat  guotai-demo guotai-uat
#    active: test
#    active: uat
    active: online-uat
#### dev out-dev  test  uat  online-uat guotai-demo
#    active: guotai-demo  国泰试运行环境
#    active: online-uat   线上预发环境
#    active: dev  本地开发环境
#    active: out-dev  外包对接环境
#    active: test 内网测试环境
#    active: uat  内网预发环境
logging:
  config: classpath:config/log/log4j2.xml