新增装备修改
This commit is contained in:
parent
3e51a73ec2
commit
f56367f300
|
|
@ -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);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 统计装备
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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 = "质检开始日期")
|
||||
|
|
|
|||
|
|
@ -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<BmFileInfo> examinationPdf = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into ma_dev_qc
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="maId != null">ma_id,</if>
|
||||
<if test="qcName != null and qcName != ''">qc_name,</if>
|
||||
<if test="nextCheckTime != null and nextCheckTime != ''">next_check_time,</if>
|
||||
<if test="qcCode != null and qcCode != ''">qc_code,</if>
|
||||
<if test="qcUser != null and qcUser != ''">qc_user,</if>
|
||||
<if test="qcCom != null and qcCom != ''">qc_com,</if>
|
||||
|
|
@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="maId != null">#{maId},</if>
|
||||
<if test="qcName != null and qcName != ''">#{qcName},</if>
|
||||
<if test="nextCheckTime != null">#{nextCheckTime},</if>
|
||||
<if test="qcCode != null and qcCode != ''">#{qcCode},</if>
|
||||
<if test="qcUser != null and qcUser != ''">#{qcUser},</if>
|
||||
<if test="qcCom != null and qcCom != ''">#{qcCom},</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue