|
@@ -8,10 +8,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
import com.gree.mall.manager.bean.workorder.PgAppraiseApplyBean;
|
|
|
+import com.gree.mall.manager.bean.workorder.PgAppraiseApplyCountBean;
|
|
|
import com.gree.mall.manager.bean.workorder.PgAppraiseApplyVO;
|
|
|
import com.gree.mall.manager.bean.workorder.PgAppraiseCategoryVO;
|
|
|
import com.gree.mall.manager.commonmapper.CommonMapper;
|
|
|
import com.gree.mall.manager.enums.ExamineStatusEnum;
|
|
|
+import com.gree.mall.manager.enums.IsEnum;
|
|
|
import com.gree.mall.manager.enums.workorder.*;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
@@ -180,15 +182,33 @@ public class AppraiseRelaLogic {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
FieldUtils.supplyParam(zfireParamBean, PgAppraiseApplyVO.class, adminUser);
|
|
|
final IPage<PgAppraiseApplyVO> page = commonMapper.appraiseApplyList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
|
|
|
- if (CollectionUtil.isNotEmpty(page.getRecords()) && adminUser.getType() == 0) {
|
|
|
- // 网点账户置空最高驳回人信息
|
|
|
+ if (CollectionUtil.isNotEmpty(page.getRecords())) {
|
|
|
+ final PgAppraiseConfig config = pgAppraiseConfigService.lambdaQuery()
|
|
|
+ .eq(PgAppraiseConfig::getCompanyWechatId, page.getRecords().get(0).getCompanyWechatId())
|
|
|
+ .eq(PgAppraiseConfig::getType, AppraiseConfigTypeEnum.SECOND_A.getKey())
|
|
|
+ .one();
|
|
|
for (PgAppraiseApplyVO record : page.getRecords()) {
|
|
|
- record.setCloseBy(null);
|
|
|
- record.setCloseTime(null);
|
|
|
- record.setRejectBy(null);
|
|
|
- record.setRejectTime(null);
|
|
|
+ if (adminUser.getType() == 0) {
|
|
|
+ // 网点账户置空最高驳回人信息
|
|
|
+ record.setCloseBy(null);
|
|
|
+ record.setCloseTime(null);
|
|
|
+ record.setRejectBy(null);
|
|
|
+ record.setRejectTime(null);
|
|
|
+ }
|
|
|
+ if (record.getIsSecond().getKey().equals(IsEnum.Y.getKey())
|
|
|
+ && Objects.nonNull(record.getSecondCreateTime())
|
|
|
+ && record.getStatus().getKey().equals(AppraiseApplyStatusEnum.WAIT.getKey())) {
|
|
|
+ // 检查二次申诉是否显示按钮
|
|
|
+ final int val = Integer.parseInt(config.getVal());
|
|
|
+ DateTime endTime = DateUtil.offsetHour(record.getSecondCreateTime(), val);
|
|
|
+
|
|
|
+ if (DateUtil.date().after(endTime)) {
|
|
|
+ record.setShowSecondBtn("0");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return page;
|
|
|
}
|
|
|
|
|
@@ -211,8 +231,8 @@ public class AppraiseRelaLogic {
|
|
|
|
|
|
if (!isAdd) {
|
|
|
// 有id查询是否有记录
|
|
|
- final PgAppraiseApply apply = pgAppraiseApplyService.getById(bean.getId());
|
|
|
- if (Objects.isNull(apply)) {
|
|
|
+ final PgAppraiseApply oldApply = pgAppraiseApplyService.getById(bean.getId());
|
|
|
+ if (Objects.isNull(oldApply)) {
|
|
|
// 没有记录置空新建
|
|
|
bean.setId(null);
|
|
|
isAdd = true;
|
|
@@ -366,7 +386,7 @@ public class AppraiseRelaLogic {
|
|
|
Date applyTime = apply.getApplyTime();
|
|
|
final PgAppraiseConfig config = pgAppraiseConfigService.lambdaQuery()
|
|
|
.eq(PgAppraiseConfig::getCompanyWechatId, apply.getCompanyWechatId())
|
|
|
- .eq(PgAppraiseConfig::getType, !apply.getIsSecond() ? AppraiseConfigTypeEnum.FIRST_A.getKey() : AppraiseConfigTypeEnum.SECOND_A.getKey())
|
|
|
+ .eq(PgAppraiseConfig::getType, !apply.getIsSecond() ? AppraiseConfigTypeEnum.FIRST_C.getKey() : AppraiseConfigTypeEnum.SECOND_C.getKey())
|
|
|
.one();
|
|
|
final int val = Integer.parseInt(config.getVal());
|
|
|
Date endTime = DateUtil.offsetHour(applyTime, val);
|
|
@@ -429,6 +449,7 @@ public class AppraiseRelaLogic {
|
|
|
PgAppraiseApply copy = new PgAppraiseApply();
|
|
|
this.copyApply(copy, apply);
|
|
|
copy.setIsSecond(true);
|
|
|
+ copy.setSecondCreateTime(DateUtil.dateSecond());
|
|
|
copy.insert();
|
|
|
}
|
|
|
|
|
@@ -467,8 +488,10 @@ public class AppraiseRelaLogic {
|
|
|
if (Objects.nonNull(apply.getCloseTime())) {
|
|
|
throw new RemoteServiceException(apply.getOrderBaseId() + "工单编号的申诉记录有“驳回不可再申诉信息”,不能操作“驳回可再申诉”");
|
|
|
}
|
|
|
- if (!apply.getStatus().equals(AppraiseApplyStatusEnum.OK.getKey())) {
|
|
|
- throw new RemoteServiceException(apply.getOrderBaseId() + "工单编号的申诉记录非“审核通过”,不能操作“驳回可再申诉”");
|
|
|
+ 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() + "工单编号的申诉记录非“审核通过”或“超时未审核”或“超时未申诉”,不能操作“驳回可再申诉”");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -534,7 +557,7 @@ public class AppraiseRelaLogic {
|
|
|
|
|
|
final List<PgAppraiseApply> applyList = pgAppraiseApplyService.lambdaQuery()
|
|
|
.in(PgAppraiseApply::getId, ids)
|
|
|
- .eq(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.OK.getKey())
|
|
|
+ .in(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.OK.getKey(), AppraiseApplyStatusEnum.OVER.getKey(), AppraiseApplyStatusEnum.OVER_APPLY.getKey())
|
|
|
.orderByAsc(PgAppraiseApply::getApplyTime)
|
|
|
.list();
|
|
|
|
|
@@ -542,8 +565,10 @@ public class AppraiseRelaLogic {
|
|
|
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())) {
|
|
|
- throw new RemoteServiceException(apply.getOrderBaseId() + "工单编号的申诉记录非“审核通过”,不能操作“驳回不可再申诉”");
|
|
|
+ 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());
|
|
|
}
|
|
@@ -570,4 +595,20 @@ public class AppraiseRelaLogic {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public PgAppraiseApplyCountBean applyCount() {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+ PgAppraiseApplyCountBean bean = new PgAppraiseApplyCountBean();
|
|
|
+
|
|
|
+ final Integer count = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .in(CollectionUtil.isNotEmpty(adminUser.getAdminWebsitIds()), PgAppraiseApply::getWebsitId, adminUser.getAdminWebsitIds())
|
|
|
+ .eq(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.WAIT.getKey())
|
|
|
+ .count();
|
|
|
+ final Integer centerCount = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .in(CollectionUtil.isNotEmpty(adminUser.getAdminWebsitIds()), PgAppraiseApply::getWebsitId, adminUser.getAdminWebsitIds())
|
|
|
+ .eq(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.WAIT_CENTER.getKey())
|
|
|
+ .count();
|
|
|
+ bean.setWaitCount(count);
|
|
|
+ bean.setCenterCount(centerCount);
|
|
|
+ return bean;
|
|
|
+ }
|
|
|
}
|