|
|
|
|
@ -58,10 +58,10 @@ public class OemMeritsServiceImpl extends BaseServiceImpl<OemMeritsMapper, OemMe |
|
|
|
|
} |
|
|
|
|
List<OemMeritsEntity> saves = new ArrayList<>(); |
|
|
|
|
for (OemMeritsEntity entity : entities) { |
|
|
|
|
entity.setUpdateTime(date); |
|
|
|
|
entity.setMonth(date); |
|
|
|
|
entity.setOmStatus(OemMeritsEntity.NEW_DATA); |
|
|
|
|
LambdaQueryWrapper<OemMeritsEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.apply("TO_CHAR(update_time, 'YYYY-MM') = TO_CHAR({0}, 'YYYY-MM')", date) |
|
|
|
|
wrapper.apply("TO_CHAR(MONTH, 'YYYY-MM') = TO_CHAR({0}, 'YYYY-MM')", date) |
|
|
|
|
.eq(OemMeritsEntity::getCaId, entity.getCaId()) |
|
|
|
|
.eq(OemMeritsEntity::getOcId, entity.getOcId()); |
|
|
|
|
// .eq(OemMeritsEntity::getOmStatus, OemMeritsEntity.NEW_DATA);
|
|
|
|
|
@ -148,9 +148,9 @@ public class OemMeritsServiceImpl extends BaseServiceImpl<OemMeritsMapper, OemMe |
|
|
|
|
// 提取所有不重复的月份(格式为yyyy-MM)
|
|
|
|
|
Set<String> monthSet = proofreadSave.getOemMeritsEntities().stream() |
|
|
|
|
.map(entity -> { |
|
|
|
|
// 使用DateTimeFormatter将updateTime格式化为"yyyy-MM"
|
|
|
|
|
// 使用DateTimeFormatter将Month格式化为"yyyy-MM"
|
|
|
|
|
return DateTimeFormatter.ofPattern("yyyy-MM") |
|
|
|
|
.format(entity.getUpdateTime().toInstant().atZone(ZoneId.systemDefault())); |
|
|
|
|
.format(entity.getMonth().toInstant().atZone(ZoneId.systemDefault())); |
|
|
|
|
}) |
|
|
|
|
.filter(Objects::nonNull) // 过滤掉可能的null值
|
|
|
|
|
.collect(Collectors.toSet()); |
|
|
|
|
@ -192,9 +192,9 @@ public class OemMeritsServiceImpl extends BaseServiceImpl<OemMeritsMapper, OemMe |
|
|
|
|
// 提取所有不重复的月份(格式为yyyy-MM)
|
|
|
|
|
Set<String> monthSet = oemMeritsEntities.stream() |
|
|
|
|
.map(entity -> { |
|
|
|
|
// 使用DateTimeFormatter将updateTime格式化为"yyyy-MM"
|
|
|
|
|
// 使用DateTimeFormatter将Month格式化为"yyyy-MM"
|
|
|
|
|
return DateTimeFormatter.ofPattern("yyyy-MM") |
|
|
|
|
.format(entity.getUpdateTime().toInstant().atZone(ZoneId.systemDefault())); |
|
|
|
|
.format(entity.getMonth().toInstant().atZone(ZoneId.systemDefault())); |
|
|
|
|
}) |
|
|
|
|
.filter(Objects::nonNull) // 过滤掉可能的null值
|
|
|
|
|
.collect(Collectors.toSet()); |
|
|
|
|
@ -335,7 +335,7 @@ public class OemMeritsServiceImpl extends BaseServiceImpl<OemMeritsMapper, OemMe |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 更新排名(以月份updateTime和工艺caId分组,根据最终得分endScore给厂商ocId排名ranking) |
|
|
|
|
* 更新排名(以月份Month和工艺caId分组,根据最终得分endScore给厂商ocId排名ranking) |
|
|
|
|
* |
|
|
|
|
* @param targetMonth 目标月份,格式为 yyyy-MM |
|
|
|
|
*/ |
|
|
|
|
@ -344,7 +344,7 @@ public class OemMeritsServiceImpl extends BaseServiceImpl<OemMeritsMapper, OemMe |
|
|
|
|
LambdaQueryWrapper<OemMeritsEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
// 按月份过滤:使用apply进行日期格式化匹配
|
|
|
|
|
queryWrapper.apply("TO_CHAR(update_time, 'YYYY-MM') = {0}", targetMonth) |
|
|
|
|
queryWrapper.apply("TO_CHAR(MONTH, 'YYYY-MM') = {0}", targetMonth) |
|
|
|
|
.eq(OemMeritsEntity::getProduceStatus, OemMeritsEntity.PRODUCT_OK) |
|
|
|
|
.eq(OemMeritsEntity::getQualityStatus, OemMeritsEntity.QUALITY_OK) |
|
|
|
|
.isNotNull(OemMeritsEntity::getEndScore) // 排除最终得分为空的数据
|
|
|
|
|
|