Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 7 months ago
parent
commit
193b39d3cb
  1. 3
      hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java
  2. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SpecialDeviceController.java
  3. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.java
  4. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml
  5. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java
  6. 24
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceServiceImpl.java

3
hzims-service/message/src/main/java/com/hnac/hzims/message/controller/MessagePushRecordController.java

@ -110,6 +110,7 @@ public class MessagePushRecordController extends BladeController {
@GetMapping("/getPersonalUnreadMessage") @GetMapping("/getPersonalUnreadMessage")
@ApiOperation("获取当前登录人待办消息") @ApiOperation("获取当前登录人待办消息")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
@Operate(label = "获取当前登录人待办消息",type = BusinessType.QUERY)
public R<List<UnreadMessageVO>> getPersonalUnreadMessage() { public R<List<UnreadMessageVO>> getPersonalUnreadMessage() {
List<UnreadMessageVO> personalUnreadMessage = messagePushRecordService.getPersonalUnreadMessage(); List<UnreadMessageVO> personalUnreadMessage = messagePushRecordService.getPersonalUnreadMessage();
return R.data(personalUnreadMessage); return R.data(personalUnreadMessage);
@ -118,7 +119,7 @@ public class MessagePushRecordController extends BladeController {
@GetMapping("/getPersonalAppUnreadMessage") @GetMapping("/getPersonalAppUnreadMessage")
@ApiOperation("获取当前登录人APP待办消息") @ApiOperation("获取当前登录人APP待办消息")
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
@Operate(label = "获取当前登录人APP待办消息",type = BusinessType.QUERY,ignore = false) @Operate(label = "获取当前登录人APP待办消息",type = BusinessType.QUERY)
public R<List<UnreadMessageVO>> getPersonalAppUnreadMessage() { public R<List<UnreadMessageVO>> getPersonalAppUnreadMessage() {
List<UnreadMessageVO> personalUnreadMessage = messagePushRecordService.getPersonalAppUnreadMessage(); List<UnreadMessageVO> personalUnreadMessage = messagePushRecordService.getPersonalAppUnreadMessage();
return R.data(personalUnreadMessage); return R.data(personalUnreadMessage);

2
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) @ApiOperationSupport(order = 3)
@Operate(label = "删除设备", type = BusinessType.DELETE, ignore = false) @Operate(label = "删除设备", type = BusinessType.DELETE, ignore = false)
public R remove(@RequestParam Long id) { public R remove(@RequestParam Long id) {
return R.status(specialDeviceService.removeById(id)); return R.status(specialDeviceService.removeDevice(id));
} }
@GetMapping("/detail") @GetMapping("/detail")

8
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 com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -23,4 +24,11 @@ public interface SpecialDeviceInspectionMapper extends BaseMapper<SpecialDeviceI
* @return 设备检验记录数据 * @return 设备检验记录数据
*/ */
IPage<SpecialDeviceInspectionEntity> getInspectionPage(IPage<SpecialDeviceInspectionEntity> page, Map<String, Object> param); IPage<SpecialDeviceInspectionEntity> getInspectionPage(IPage<SpecialDeviceInspectionEntity> page, Map<String, Object> param);
/**
* 获取设备相关检验记录
* @param deviceId 设备id
* @return 设备检验记录列表
*/
List<SpecialDeviceInspectionEntity> getRefDeviceInspection(Long deviceId);
} }

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/SpecialDeviceInspectionMapper.xml

@ -21,4 +21,15 @@
ORDER BY ORDER BY
create_time DESC create_time DESC
</select> </select>
<select id="getRefDeviceInspection"
resultType="com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity">
SELECT
*
FROM
hzims_device_inspection
WHERE
is_deleted = 0
AND device_id = #{deviceId}
</select>
</mapper> </mapper>

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISpecialDeviceService.java

@ -19,4 +19,11 @@ public interface ISpecialDeviceService extends IService<SpecialDeviceEntity> {
* @param endTime 结束时间 * @param endTime 结束时间
*/ */
List<SpecialDeviceEntity> getExpiredDeviceByTime(String startTime, String endTime); List<SpecialDeviceEntity> getExpiredDeviceByTime(String startTime, String endTime);
/**
* 删除特种设备
* @param id 设备id
* @return true-成功false-失败
*/
boolean removeDevice(Long id);
} }

24
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.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.SpecialDeviceEntity;
import com.hnac.hzims.safeproduct.entity.SpecialDeviceInspectionEntity;
import com.hnac.hzims.safeproduct.enums.DeviceStatusEnum; 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.mapper.SpecialDeviceMapper;
import com.hnac.hzims.safeproduct.service.ISpecialDeviceService; import com.hnac.hzims.safeproduct.service.ISpecialDeviceService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 特种设备服务实现类 * 特种设备服务实现类
@ -19,6 +25,9 @@ import java.util.List;
@Service @Service
public class SpecialDeviceServiceImpl extends ServiceImpl<SpecialDeviceMapper, SpecialDeviceEntity> implements ISpecialDeviceService { public class SpecialDeviceServiceImpl extends ServiceImpl<SpecialDeviceMapper, SpecialDeviceEntity> implements ISpecialDeviceService {
@Resource
SpecialDeviceInspectionMapper specialDeviceInspectionMapper;
/** /**
* 查找时间范围内的过期设备 * 查找时间范围内的过期设备
*/ */
@ -30,4 +39,19 @@ public class SpecialDeviceServiceImpl extends ServiceImpl<SpecialDeviceMapper, S
.le(SpecialDeviceEntity::getInspectionNextTime, endTime); .le(SpecialDeviceEntity::getInspectionNextTime, endTime);
return this.list(queryWrapper); return this.list(queryWrapper);
} }
/**
* 删除特种设备
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean removeDevice(Long id) {
List<SpecialDeviceInspectionEntity> inspections = specialDeviceInspectionMapper.getRefDeviceInspection(id);
List<Long> ids = inspections.stream().map(SpecialDeviceInspectionEntity::getId).collect(Collectors.toList());
int removeInspection = specialDeviceInspectionMapper.deleteBatchIds(ids);
if (removeInspection == SafeProductConstant.SUCCESS) {
return this.removeById(id);
}
return false;
}
} }

Loading…
Cancel
Save