Browse Source

fix: 特种设备管理逻辑修改

zhongwei
liwen 7 months ago
parent
commit
fc36c5eb79
  1. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java
  2. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java

3
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SpecialDeviceInspectionEntity.java

@ -1,8 +1,6 @@
package com.hnac.hzims.safeproduct.entity; package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -21,7 +19,6 @@ public class SpecialDeviceInspectionEntity extends BaseEntity {
@ApiModelProperty("设备id") @ApiModelProperty("设备id")
private Long deviceId; private Long deviceId;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("检验时间") @ApiModelProperty("检验时间")
private Date inspectionTime; private Date inspectionTime;

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SpecialDeviceInspectionServiceImpl.java

@ -48,6 +48,9 @@ public class SpecialDeviceInspectionServiceImpl extends ServiceImpl<SpecialDevic
specialDeviceInspectionEntity.setNextInspectionTime(nextInspectDate); specialDeviceInspectionEntity.setNextInspectionTime(nextInspectDate);
specialDeviceEntity.setInspectionNextTime(nextInspectDate); specialDeviceEntity.setInspectionNextTime(nextInspectDate);
// 获取上一次检验时间 // 获取上一次检验时间
if (specialDeviceInspectionEntity.getLastInspectionTime() != null) {
specialDeviceEntity.setInspectionLastTime(specialDeviceInspectionEntity.getLastInspectionTime());
} else {
QueryWrapper<SpecialDeviceInspectionEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<SpecialDeviceInspectionEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SpecialDeviceInspectionEntity::getDeviceId, deviceId) queryWrapper.lambda().eq(SpecialDeviceInspectionEntity::getDeviceId, deviceId)
.orderByDesc(SpecialDeviceInspectionEntity::getInspectionTime); .orderByDesc(SpecialDeviceInspectionEntity::getInspectionTime);
@ -58,6 +61,7 @@ public class SpecialDeviceInspectionServiceImpl extends ServiceImpl<SpecialDevic
specialDeviceInspectionEntity.setLastInspectionTime(lastInspectionTime); specialDeviceInspectionEntity.setLastInspectionTime(lastInspectionTime);
specialDeviceEntity.setInspectionLastTime(lastInspectionTime); specialDeviceEntity.setInspectionLastTime(lastInspectionTime);
} }
}
// 本次检验时间 // 本次检验时间
specialDeviceEntity.setInspectionCurrentTime(specialDeviceInspectionEntity.getInspectionTime()); specialDeviceEntity.setInspectionCurrentTime(specialDeviceInspectionEntity.getInspectionTime());
boolean save = this.save(specialDeviceInspectionEntity); boolean save = this.save(specialDeviceInspectionEntity);

Loading…
Cancel
Save