feat():设定值接口修改

This commit is contained in:
Allenxy
2024-10-13 14:03:05 +08:00
parent e30dcc477e
commit 77c759fabf
6 changed files with 19 additions and 16 deletions

View File

@@ -26,7 +26,7 @@ public class ModSetupResult {
private String coilId;
@ApiModelProperty(value = "道次号")
private Integer passId;
private Integer passno;
@ApiModelProperty(value = "机架号")
private Integer standId;

View File

@@ -14,12 +14,10 @@ public class CrmPdoExcoilForm {
@ApiModelProperty(value = "钢卷号")
private String encoilid;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "开始日期")
private LocalDateTime startDate;
private String startDate;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "结束日期")
private LocalDateTime endDate;
private String endDate;
}

View File

@@ -13,7 +13,7 @@ public class ModSetupResultForm {
private String grade;
@ApiModelProperty(value = "道次号")
private Integer passId;
private Integer passno;
@ApiModelProperty(value = "退火厚度")
private Integer annealThick;

View File

@@ -21,18 +21,23 @@ public class ModSetupResultServiceImpl extends ServiceImpl<ModSetupResultMapper,
// 确保各个字段的非空验证
if (StringUtils.isEmpty(form.getGrade()) || form.getAnnealThick() == null ||
form.getEntryThick() == null || form.getExitThick() == null || form.getPassId() == null) {
form.getEntryThick() == null || form.getExitThick() == null || form.getPassno() == null) {
throw new IllegalArgumentException("必要的字段缺失");
}
// 去除Double类型的字段的小数位
int annealThick = form.getAnnealThick();
int entryThick = form.getEntryThick().intValue(); // 去除小数位
int exitThick = form.getExitThick().intValue(); // 去除小数位
int passId = form.getPassId();
// 获取厚度并处理
int annealThick = Math.round(form.getAnnealThick() * 100); // 乘以100并四舍五入
int entryThick = (int) Math.round(form.getEntryThick() * 100); // 乘以100并四舍五入
int exitThick = (int) Math.round(form.getExitThick() * 100); // 乘以100并四舍五入
// 格式化为三位数字
String annealThickStr = String.format("%03d", annealThick);
String entryThickStr = String.format("%03d", entryThick);
String exitThickStr = String.format("%03d", exitThick);
// 根据字段构建 calcId
String calcId = form.getGrade() + annealThick + entryThick + exitThick + passId;
String calcId = form.getGrade() + annealThickStr + entryThickStr + exitThickStr + form.getPassno();
// 实际查询代码(根据 calcId 查询数据)
// 这里假设查询方法为根据 calcId 查找结果

View File

@@ -23,7 +23,7 @@ public class ModSetupResultVO {
private String coilId;
@ApiModelProperty(value = "道次号")
private Integer passId;
private Integer passno;
@ApiModelProperty(value = "入口厚度")
private Float entryThick;