From 4426c3b67addfd9caaf3f8def12fffeaaa025353 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Thu, 18 Apr 2024 20:49:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?#=20=E6=B6=88=E6=81=AF=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=9C=AA=E8=AF=BB=E6=B6=88=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E6=97=A5=E5=BF=97=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/message/controller/MessagePushRecordController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java index 33c3cd1..0371b5d 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java @@ -110,6 +110,7 @@ public class MessagePushRecordController extends BladeController { @GetMapping("/getPersonalUnreadMessage") @ApiOperation("获取当前登录人待办消息") @ApiOperationSupport(order = 8) + @Operate(label = "获取当前登录人待办消息",type = BusinessType.QUERY) public R> getPersonalUnreadMessage() { List personalUnreadMessage = messagePushRecordService.getPersonalUnreadMessage(); return R.data(personalUnreadMessage); @@ -118,7 +119,7 @@ public class MessagePushRecordController extends BladeController { @GetMapping("/getPersonalAppUnreadMessage") @ApiOperation("获取当前登录人APP待办消息") @ApiOperationSupport(order = 9) - @Operate(label = "获取当前登录人APP待办消息",type = BusinessType.QUERY,ignore = false) + @Operate(label = "获取当前登录人APP待办消息",type = BusinessType.QUERY) public R> getPersonalAppUnreadMessage() { List personalUnreadMessage = messagePushRecordService.getPersonalAppUnreadMessage(); return R.data(personalUnreadMessage); From a49c0e96a5390b5eb5beb9377d18ad770f5644a0 Mon Sep 17 00:00:00 2001 From: liwen Date: Thu, 18 Apr 2024 20:51:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E7=89=B9=E7=A7=8D?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=90=8C=E6=AD=A5=E5=88=A0=E9=99=A4=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=9A=84=E6=A3=80=E9=AA=8C=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SpecialDeviceController.java | 2 +- .../mapper/SpecialDeviceInspectionMapper.java | 8 ++++++++ .../mapper/SpecialDeviceInspectionMapper.xml | 11 ++++++++++ .../safeproduct/service/ISpecialDeviceService.java | 7 +++++++ .../service/impl/SpecialDeviceServiceImpl.java | 24 ++++++++++++++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java index ffde215..2f46bd3 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java @@ -63,7 +63,7 @@ public class SpecialDeviceController extends BladeController { @ApiOperationSupport(order = 3) @Operate(label = "删除设备", type = BusinessType.DELETE, ignore = false) public R remove(@RequestParam Long id) { - return R.status(specialDeviceService.removeById(id)); + return R.status(specialDeviceService.removeDevice(id)); } @GetMapping("/detail") diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java index fec09d7..4bbe2e9 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; import java.util.Map; /** @@ -23,4 +24,11 @@ public interface SpecialDeviceInspectionMapper extends BaseMapper getInspectionPage(IPage page, Map param); + + /** + * 获取设备相关检验记录 + * @param deviceId 设备id + * @return 设备检验记录列表 + */ + List getRefDeviceInspection(Long deviceId); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml index 5b98348..413e532 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml @@ -21,4 +21,15 @@ ORDER BY create_time DESC + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java index ebcbe1c..686039c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java @@ -19,4 +19,11 @@ public interface ISpecialDeviceService extends IService { * @param endTime 结束时间 */ List getExpiredDeviceByTime(String startTime, String endTime); + + /** + * 删除特种设备 + * @param id 设备id + * @return true-成功,false-失败 + */ + boolean removeDevice(Long id); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java index 179568e..ec201ff 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java @@ -2,13 +2,19 @@ package com.hnac.hzims.safeproduct.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.entity.SpecialDeviceEntity; +import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity; import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; +import com.hnac.hzims.safeproduct.mapper.SpecialDeviceInspectionMapper; import com.hnac.hzims.safeproduct.mapper.SpecialDeviceMapper; import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.util.List; +import java.util.stream.Collectors; /** * 特种设备服务实现类 @@ -19,6 +25,9 @@ import java.util.List; @Service public class SpecialDeviceServiceImpl extends ServiceImpl implements ISpecialDeviceService { + @Resource + SpecialDeviceInspectionMapper specialDeviceInspectionMapper; + /** * 查找时间范围内的过期设备 */ @@ -30,4 +39,19 @@ public class SpecialDeviceServiceImpl extends ServiceImpl inspections = specialDeviceInspectionMapper.getRefDeviceInspection(id); + List ids = inspections.stream().map(SpecialDeviceInspectionEntity::getId).collect(Collectors.toList()); + int removeInspection = specialDeviceInspectionMapper.deleteBatchIds(ids); + if (removeInspection == SafeProductConstant.SUCCESS) { + return this.removeById(id); + } + return false; + } }