|
@@ -8,8 +8,10 @@ import com.gree.mall.manager.enums.workorder.AppraiseOnusEnum;
|
|
import com.gree.mall.manager.enums.workorder.AppraiseStatusEnum;
|
|
import com.gree.mall.manager.enums.workorder.AppraiseStatusEnum;
|
|
import com.gree.mall.manager.plus.entity.PgAppraiseApply;
|
|
import com.gree.mall.manager.plus.entity.PgAppraiseApply;
|
|
import com.gree.mall.manager.plus.entity.PgAppraiseConfig;
|
|
import com.gree.mall.manager.plus.entity.PgAppraiseConfig;
|
|
|
|
+import com.gree.mall.manager.plus.entity.PgOrderBase;
|
|
import com.gree.mall.manager.plus.service.PgAppraiseApplyService;
|
|
import com.gree.mall.manager.plus.service.PgAppraiseApplyService;
|
|
import com.gree.mall.manager.plus.service.PgAppraiseConfigService;
|
|
import com.gree.mall.manager.plus.service.PgAppraiseConfigService;
|
|
|
|
+import com.gree.mall.manager.plus.service.PgOrderBaseService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
@@ -31,14 +33,16 @@ public class AppraiseApplySchedule {
|
|
PgAppraiseApplyService pgAppraiseApplyService;
|
|
PgAppraiseApplyService pgAppraiseApplyService;
|
|
@Resource
|
|
@Resource
|
|
PgAppraiseConfigService pgAppraiseConfigService;
|
|
PgAppraiseConfigService pgAppraiseConfigService;
|
|
|
|
+ @Resource
|
|
|
|
+ PgOrderBaseService pgOrderBaseService;
|
|
@Value("${spring.profiles.active}")
|
|
@Value("${spring.profiles.active}")
|
|
private String env;
|
|
private String env;
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 发送模板通知
|
|
|
|
|
|
+ * 待中心审核检查超时
|
|
*/
|
|
*/
|
|
- @Scheduled(fixedDelay = 5 * 1000)
|
|
|
|
- public void task2(){
|
|
|
|
|
|
+ @Scheduled(fixedDelay = 2 * 1000)
|
|
|
|
+ public void task1(){
|
|
if(env.equals("test") || env.equals("prd")) {
|
|
if(env.equals("test") || env.equals("prd")) {
|
|
final List<PgAppraiseApply> applyList = pgAppraiseApplyService.lambdaQuery()
|
|
final List<PgAppraiseApply> applyList = pgAppraiseApplyService.lambdaQuery()
|
|
.eq(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.WAIT_CENTER.getKey())
|
|
.eq(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.WAIT_CENTER.getKey())
|
|
@@ -71,10 +75,58 @@ public class AppraiseApplySchedule {
|
|
.set(PgAppraiseApply::getSettleConfirmTime, null)
|
|
.set(PgAppraiseApply::getSettleConfirmTime, null)
|
|
.eq(PgAppraiseApply::getId, apply.getId())
|
|
.eq(PgAppraiseApply::getId, apply.getId())
|
|
.update();
|
|
.update();
|
|
|
|
+ pgOrderBaseService.lambdaUpdate()
|
|
|
|
+ .eq(PgOrderBase::getAppraiseApplyResult, AppraiseStatusEnum.A.getKey())
|
|
|
|
+ .eq(PgOrderBase::getId, apply.getId())
|
|
|
|
+ .update();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 二次申诉检查超时
|
|
|
|
+ */
|
|
|
|
+ @Scheduled(fixedDelay = 2 * 1000)
|
|
|
|
+ public void task2(){
|
|
|
|
+ if(env.equals("test") || env.equals("prd")) {
|
|
|
|
+ final List<PgAppraiseApply> applyList = pgAppraiseApplyService.lambdaQuery()
|
|
|
|
+ .eq(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.WAIT.getKey())
|
|
|
|
+ .eq(PgAppraiseApply::getIsSecond, true)
|
|
|
|
+ .isNotNull(PgAppraiseApply::getSettleConfirmTime)
|
|
|
|
+ .list();
|
|
|
|
+ if (CollectionUtil.isNotEmpty(applyList)) {
|
|
|
|
+ // 二次申诉时间不能超时,从中心首次审核时间开始计算
|
|
|
|
+ final PgAppraiseConfig config = pgAppraiseConfigService.lambdaQuery()
|
|
|
|
+ .eq(PgAppraiseConfig::getCompanyWechatId, applyList.get(0).getCompanyWechatId())
|
|
|
|
+ .eq(PgAppraiseConfig::getType, AppraiseConfigTypeEnum.SECOND_A.getKey())
|
|
|
|
+ .one();
|
|
|
|
+
|
|
|
|
+ for (PgAppraiseApply apply : applyList) {
|
|
|
|
+ String value = config.getVal();
|
|
|
|
+ final int val = Integer.parseInt(value);
|
|
|
|
+ Date endTime = DateUtil.offsetHour(apply.getApplyTime(), val);
|
|
|
|
+ if (DateUtil.date().after(endTime)) {
|
|
|
|
+ pgAppraiseApplyService.lambdaUpdate()
|
|
|
|
+ .set(PgAppraiseApply::getExamineResult, apply.getAppraiseStatus())
|
|
|
|
+ .set(PgAppraiseApply::getStatus, AppraiseApplyStatusEnum.OVER_APPLY.getKey())
|
|
|
|
+ .set(PgAppraiseApply::getWebsitResult, AppraiseOnusEnum.ALL.getKey())
|
|
|
|
+ .set(PgAppraiseApply::getCategoryId, null)
|
|
|
|
+ .set(PgAppraiseApply::getParentCategoryId, null)
|
|
|
|
+ .set(PgAppraiseApply::getCategoryName, null)
|
|
|
|
+ .set(PgAppraiseApply::getParentCategoryName, null)
|
|
|
|
+ .set(PgAppraiseApply::getIsWebsitCall, null)
|
|
|
|
+ .set(PgAppraiseApply::getConfirmBy, "超时未申诉")
|
|
|
|
+ .eq(PgAppraiseApply::getId, apply.getId())
|
|
|
|
+ .update();
|
|
|
|
+ pgOrderBaseService.lambdaUpdate()
|
|
|
|
+ .eq(PgOrderBase::getAppraiseApplyResult, apply.getAppraiseStatus())
|
|
|
|
+ .eq(PgOrderBase::getId, apply.getId())
|
|
|
|
+ .update();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|