|
@@ -33,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Slf4j
|
|
@@ -494,12 +495,38 @@ public class AppraiseRelaLogic {
|
|
|
throw new RemoteServiceException("请选择记录");
|
|
|
}
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+
|
|
|
+ final List<PgAppraiseApply> applyList = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .in(PgAppraiseApply::getId, ids)
|
|
|
+ .eq(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.OK.getKey())
|
|
|
+ .orderByAsc(PgAppraiseApply::getApplyTime)
|
|
|
+ .list();
|
|
|
+
|
|
|
+ if (CollectionUtil.isNotEmpty(applyList)) {
|
|
|
+ final List<String> orderIds = applyList.stream().map(PgAppraiseApply::getOrderBaseId).collect(Collectors.toList());
|
|
|
+ final Map<String, PgAppraiseApply> applyMap = applyList.stream().collect(Collectors.toMap(PgAppraiseApply::getOrderBaseId, Function.identity(), (key1, key2) -> key2));
|
|
|
+ for (PgAppraiseApply apply : applyList) {
|
|
|
+ apply.setExamineResult(apply.getAppraiseStatus());
|
|
|
+ }
|
|
|
+ pgAppraiseApplyService.saveBatch(applyList);
|
|
|
+
|
|
|
+ for (String orderId : orderIds) {
|
|
|
+ final PgAppraiseApply apply = applyMap.get(orderId);
|
|
|
+ if (Objects.nonNull(apply)) {
|
|
|
+ pgOrderBaseService.lambdaUpdate()
|
|
|
+ .set(PgOrderBase::getAppraiseApplyResult, apply.getAppraiseStatus())
|
|
|
+ .eq(PgOrderBase::getId, orderId)
|
|
|
+ .update();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
pgAppraiseApplyService.lambdaUpdate()
|
|
|
- .set(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.OK.getKey())
|
|
|
.set(PgAppraiseApply::getCloseBy, adminUser.getNickName())
|
|
|
.set(PgAppraiseApply::getCloseTime, DateUtil.date())
|
|
|
.in(PgAppraiseApply::getId, ids)
|
|
|
- .in(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.WAIT.getKey(), AppraiseApplyStatusEnum.WAIT_CENTER.getKey())
|
|
|
+ .eq(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.OK.getKey())
|
|
|
.update();
|
|
|
}
|
|
|
|