|
|
|
@ -93,26 +93,6 @@ public class ConfigTreatmentPlanManageServiceImpl implements ConfigTreatmentPlan
|
|
|
|
|
return configTreatmentPlanService.updateById(configDrug);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<ConfigTreatmentPlan> queryFirstMeasures(Integer disposalMethod,String disposalPlanId) {
|
|
|
|
|
List<ConfigTreatmentPlan> list = configTreatmentPlanService.lambdaQuery()
|
|
|
|
|
.eq(Objects.nonNull(disposalMethod), ConfigTreatmentPlan::getDisposalMethod, disposalMethod)
|
|
|
|
|
.eq(StrUtil.isNotEmpty(disposalPlanId), ConfigTreatmentPlan::getDisposalPlanId, disposalPlanId)
|
|
|
|
|
.list();
|
|
|
|
|
if (CollectionUtil.isEmpty(list)){
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return list.stream().filter(distinctPredicate(item->StrUtil.join(",",
|
|
|
|
|
item.getDisposalMethod(),item.getDisposalPlanId(),item.getFirstMeasuresId())))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static <K> Predicate<K> distinctPredicate(Function<K,Object> function){
|
|
|
|
|
ConcurrentHashMap<Object, Boolean> map = new ConcurrentHashMap<>();
|
|
|
|
|
return (t)-> null == map.putIfAbsent(function.apply(t),true);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void saveAssert(ConfigTreatmentPlan configDrug){
|
|
|
|
|
Assert.isTrue(StrUtil.isEmpty(configDrug.getId()),"id 不为空");
|
|
|
|
|