Commit b2e81bbb authored by 李秀明's avatar 李秀明

fix: 装备详情剩余服役天数缺失

parent d164866c
...@@ -390,15 +390,14 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe ...@@ -390,15 +390,14 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
} }
} }
// 剩余服役天数 = 报废日期 - 当前日期 // 剩余服役天数 = 报废日期 - 当前日期
String scrapDate = scrapInfo.getOrDefault("scrapDate", "").toString(); Date scrapDate = equipmentDetail.getScrapDate();
if (Objects.nonNull(scrapDate)) { if (Objects.nonNull(scrapDate)) {
Date nowDate = DateUtils.getDateNow(); Date nowDate = DateUtils.getDateNow();
try { try {
Date date = dateFormat.parse(scrapDate); int i = DateUtils.dateBetween(scrapDate, nowDate);
int i = DateUtils.dateBetween(date, nowDate); equipmentDetail.setRemainingDays(Integer.parseInt(String.valueOf(i).replace("-", "")));
equipmentDetail.setRemainingDays(i);
} catch (ParseException e) { } catch (ParseException e) {
log.error("时间格式异常:", e); log.error("时间计算异常:", e);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment