|
@@ -266,7 +266,7 @@ public class AppraiseRelaLogic {
|
|
|
final PgAppraiseApply beforeApply = pgAppraiseApplyService.lambdaQuery()
|
|
|
.eq(PgAppraiseApply::getIsSecond, false)
|
|
|
.eq(PgAppraiseApply::getOrderBaseId, bean.getOrderBaseId())
|
|
|
- .orderByDesc(PgAppraiseApply::getApplyTime)
|
|
|
+ .orderByDesc(PgAppraiseApply::getCreateTime)
|
|
|
.last("limit 1")
|
|
|
.one();
|
|
|
|
|
@@ -461,11 +461,18 @@ public class AppraiseRelaLogic {
|
|
|
// 首次申诉:判定网点【全责】的,审核结果为【驳回】,触发二次可申诉
|
|
|
// 二次申诉:判定网点【全责】的,审核结果为【驳回】,维护原评价
|
|
|
apply.setExamineResult(orderBase.getAppraiseStatus());
|
|
|
- PgAppraiseApply copy = new PgAppraiseApply();
|
|
|
- this.copyApply(copy, apply);
|
|
|
- copy.setIsSecond(true);
|
|
|
- copy.setSecondCreateTime(DateUtil.dateSecond());
|
|
|
- copy.insert();
|
|
|
+ final Integer supCount = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .eq(PgAppraiseApply::getIsSecond, false)
|
|
|
+ .eq(PgAppraiseApply::getOrderBaseId, bean.getOrderBaseId())
|
|
|
+ .isNotNull(PgAppraiseApply::getRejectTime)
|
|
|
+ .count();
|
|
|
+ if (!apply.getIsSecond() && supCount == 0) {
|
|
|
+ PgAppraiseApply copy = new PgAppraiseApply();
|
|
|
+ this.copyApply(copy, apply);
|
|
|
+ copy.setIsSecond(true);
|
|
|
+ copy.setSecondCreateTime(DateUtil.dateSecond());
|
|
|
+ copy.insert();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
apply.updateById();
|
|
@@ -496,6 +503,24 @@ public class AppraiseRelaLogic {
|
|
|
.in(PgAppraiseApply::getId, ids)
|
|
|
.list();
|
|
|
|
|
|
+ Integer count = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .in(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.WAIT.getKey(), AppraiseApplyStatusEnum.WAIT_CENTER.getKey())
|
|
|
+ .in(PgAppraiseApply::getId, ids)
|
|
|
+ .count();
|
|
|
+
|
|
|
+ if (count > 0) {
|
|
|
+ throw new RemoteServiceException("有“待申诉”或“待中心审核”申诉记录,不能操作“驳回可再申诉”");
|
|
|
+ }
|
|
|
+
|
|
|
+ count = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .isNotNull(PgAppraiseApply::getCloseTime)
|
|
|
+ .in(PgAppraiseApply::getId, ids)
|
|
|
+ .count();
|
|
|
+
|
|
|
+ if (count > 0) {
|
|
|
+ throw new RemoteServiceException("有“驳回不可再申诉信息”申诉记录,不能操作“驳回可再申诉”");
|
|
|
+ }
|
|
|
+
|
|
|
for (PgAppraiseApply apply : applyList) {
|
|
|
if (Objects.nonNull(apply.getRejectTime())) {
|
|
|
throw new RemoteServiceException(apply.getOrderBaseId() + "工单编号的申诉记录有“驳回可重申诉信息”,不能操作“驳回可再申诉”");
|
|
@@ -576,27 +601,29 @@ public class AppraiseRelaLogic {
|
|
|
.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) {
|
|
|
- if (!(apply.getStatus().equals(AppraiseApplyStatusEnum.OK.getKey())
|
|
|
- || apply.getStatus().equals(AppraiseApplyStatusEnum.OVER.getKey())
|
|
|
- || apply.getStatus().equals(AppraiseApplyStatusEnum.OVER_APPLY.getKey()))) {
|
|
|
- throw new RemoteServiceException(apply.getOrderBaseId() + "工单编号的申诉记录非“审核通过”或“超时未审核”或“超时未申诉”,不能操作“驳回不可再申诉”");
|
|
|
- }
|
|
|
- apply.setExamineResult(apply.getAppraiseStatus());
|
|
|
+ if (CollectionUtil.isEmpty(applyList)) {
|
|
|
+ throw new RemoteServiceException("未找到申诉记录为“审核通过”或“超时未审核”或“超时未申诉”,不能操作“驳回不可再申诉”");
|
|
|
+ }
|
|
|
+
|
|
|
+ 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) {
|
|
|
+ if (!(apply.getStatus().equals(AppraiseApplyStatusEnum.OK.getKey())
|
|
|
+ || apply.getStatus().equals(AppraiseApplyStatusEnum.OVER.getKey())
|
|
|
+ || apply.getStatus().equals(AppraiseApplyStatusEnum.OVER_APPLY.getKey()))) {
|
|
|
+ throw new RemoteServiceException(apply.getOrderBaseId() + "工单编号的申诉记录非“审核通过”或“超时未审核”或“超时未申诉”,不能操作“驳回不可再申诉”");
|
|
|
}
|
|
|
- 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();
|
|
|
- }
|
|
|
+ apply.setExamineResult(apply.getAppraiseStatus());
|
|
|
+ }
|
|
|
+ pgAppraiseApplyService.saveOrUpdateBatch(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();
|
|
|
}
|
|
|
}
|
|
|
|