diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/controller/DevInfoController.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/controller/DevInfoController.java index f54c6ec..732d1e1 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/controller/DevInfoController.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/controller/DevInfoController.java @@ -183,15 +183,6 @@ public class DevInfoController extends BaseController { return devInfoService.insertDevInfo(devInfo); } - /** - * 设备信息录入--保存草稿--不校验必填 - */ -/* @ApiOperation(value = "草稿新增(该接口已废弃)") - @PostMapping("/insertDraft") - public AjaxResult insertDraft(@NotNull @RequestBody DevInfo devInfo) { - return devInfoService.insertDraft(devInfo); - }*/ - /** * 统计装备 */ diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/MaDevQc.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/MaDevQc.java index 688ca7c..e46560d 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/MaDevQc.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/MaDevQc.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; import java.io.Serializable; @@ -34,8 +35,10 @@ public class MaDevQc extends BaseEntity implements Serializable { @ApiModelProperty(value = "装备名称") private String deviceName; - @ApiModelProperty(value = "质检名称") - private String qcName; + @ApiModelProperty(value = "下次检验日期") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date nextCheckTime; @ApiModelProperty(value = "质检编码") private String qcCode; @@ -44,7 +47,8 @@ public class MaDevQc extends BaseEntity implements Serializable { private String qcUser; @ApiModelProperty(value = "质检日期") - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date qcTime; @ApiModelProperty(value = "质检开始日期") diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/Table.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/Table.java index 3ab073f..622f04a 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/Table.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/domain/Table.java @@ -1,10 +1,13 @@ package com.bonus.material.device.domain; import com.bonus.common.biz.domain.BmFileInfo; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -21,10 +24,14 @@ public class Table { private String checkMan; @ApiModelProperty(value = "检测日期") - private String checkDate; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date checkDate; @ApiModelProperty(value = "下次检测日期") - private String nextCheckDate; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date nextCheckDate; @ApiModelProperty(value = "检测证明pdf") private List examinationPdf = new ArrayList<>(); diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java index 237313b..4600b14 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/device/service/impl/DevInfoServiceImpl.java @@ -14,6 +14,7 @@ import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.book.domain.BookCarInfoDto; import com.bonus.material.device.domain.DevInfo; import com.bonus.material.device.domain.MaDevQc; +import com.bonus.material.device.domain.Table; import com.bonus.material.device.domain.dto.DevInfoImpDto; import com.bonus.material.device.domain.dto.InfoMotionDto; import com.bonus.material.device.domain.vo.DevInfoPropertyVo; @@ -339,7 +340,8 @@ public class DevInfoServiceImpl implements DevInfoService { devInfoMapper.insertDevInfoProperties(devInfo.getMaId(), devInfo.getDevInfoProperties()); } //把文件保存到附件中 - AjaxResult error = uploadFiles(devInfo, userId, i); + Table table = devInfo.getTableList().get(i); + AjaxResult error = uploadFiles(table, devInfo, userId, i); if (error != null) { return error; } @@ -354,7 +356,7 @@ public class DevInfoServiceImpl implements DevInfoService { * @param userId 用户ID * @return 无异常返回null ,报错返回AjaxResult */ - private AjaxResult uploadFiles(DevInfo devInfo, Long userId, Integer i) { + private AjaxResult uploadFiles(Table table, DevInfo devInfo, Long userId, Integer i) { if (userId == null) { return AjaxResult.error("用户信息获取失败,请刷新后重试"); } @@ -400,6 +402,9 @@ public class DevInfoServiceImpl implements DevInfoService { MaDevQc maDevQc = new MaDevQc(); maDevQc.setMaId(devInfo.getMaId().intValue()); maDevQc.setFileInfoList(devInfo.getTableList().get(i).getExaminationPdf()); + maDevQc.setNextCheckTime(table.getNextCheckDate()); + maDevQc.setQcUser(table.getCheckMan()); + maDevQc.setQcTime(table.getCheckDate()); maDevQcService.addDev(maDevQc); } @@ -747,7 +752,7 @@ public class DevInfoServiceImpl implements DevInfoService { devInfoVo.setRentNum(devInfo1.getRentNum()); devInfoVo.setMaStatus(devInfo1.getMaStatus()); } - if (rentNum != null){ + if (rentNum != null) { devList = devList.stream().filter(devInfoVo -> devInfoVo.getRentNum().equals(rentNum)).collect(Collectors.toList()); } return devList; diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/MaDevQcMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/MaDevQcMapper.xml index 4cc0931..af41436 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/MaDevQcMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/device/MaDevQcMapper.xml @@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into ma_dev_qc ma_id, - qc_name, + next_check_time, qc_code, qc_user, qc_com, @@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{maId}, - #{qcName}, + #{nextCheckTime}, #{qcCode}, #{qcUser}, #{qcCom},