|
|
@@ -1,5 +1,7 @@
|
|
|
package com.izouma.wenlvju.service;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.izouma.wenlvju.domain.ArtType;
|
|
|
import com.izouma.wenlvju.domain.Organization;
|
|
|
import com.izouma.wenlvju.domain.Performance;
|
|
|
@@ -12,6 +14,7 @@ import com.izouma.wenlvju.repo.OrganizationRepo;
|
|
|
import com.izouma.wenlvju.repo.PerformanceApplyRepo;
|
|
|
import com.izouma.wenlvju.repo.PerformanceRepo;
|
|
|
import com.izouma.wenlvju.utils.JpaUtils;
|
|
|
+import com.izouma.wenlvju.utils.ObjUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -155,6 +158,23 @@ public class PerformanceApplyService {
|
|
|
return applyList;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public void saveArrangement(String applies) {
|
|
|
+ List<PerformanceApply> applyList = JSONObject.parseArray(applies, PerformanceApply.class);
|
|
|
+ List<Long> ids = applyList.stream().map(PerformanceApply::getId).collect(Collectors.toList());
|
|
|
+ Map<Long, PerformanceApply> applyMap = performanceApplyRepo.findAllById(ids)
|
|
|
+ .stream()
|
|
|
+ .collect(Collectors.toMap(PerformanceApply::getId, apply -> apply));
|
|
|
+
|
|
|
+ applyList.forEach(list -> {
|
|
|
+ PerformanceApply apply = applyMap.get(list.getId());
|
|
|
+ if (ObjectUtil.isNull(apply)){
|
|
|
+ ObjUtils.merge(apply, list);
|
|
|
+ performanceApplyRepo.save(apply);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
自动评奖
|
|
|
*/
|