|
@@ -1,9 +1,11 @@
|
|
package com.chelvc.cloud.vehicle.server.service.impl;
|
|
package com.chelvc.cloud.vehicle.server.service.impl;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.chelvc.cloud.uc.api.model.Scope;
|
|
import com.chelvc.cloud.uc.api.service.UserService;
|
|
import com.chelvc.cloud.uc.api.service.UserService;
|
|
import com.chelvc.cloud.vehicle.api.dto.MerchantAuthDTO;
|
|
import com.chelvc.cloud.vehicle.api.dto.MerchantAuthDTO;
|
|
import com.chelvc.cloud.vehicle.api.param.MerchantAuthModifyParam;
|
|
import com.chelvc.cloud.vehicle.api.param.MerchantAuthModifyParam;
|
|
@@ -16,6 +18,7 @@ import com.chelvc.cloud.vehicle.server.service.MerchantService;
|
|
import com.chelvc.framework.base.context.SessionContextHolder;
|
|
import com.chelvc.framework.base.context.SessionContextHolder;
|
|
import com.chelvc.framework.common.model.Pagination;
|
|
import com.chelvc.framework.common.model.Pagination;
|
|
import com.chelvc.framework.common.util.AssertUtils;
|
|
import com.chelvc.framework.common.util.AssertUtils;
|
|
|
|
+import com.chelvc.framework.common.util.ObjectUtils;
|
|
import com.chelvc.framework.common.util.StringUtils;
|
|
import com.chelvc.framework.common.util.StringUtils;
|
|
import com.chelvc.framework.database.context.DatabaseContextHolder;
|
|
import com.chelvc.framework.database.context.DatabaseContextHolder;
|
|
import lombok.NonNull;
|
|
import lombok.NonNull;
|
|
@@ -57,8 +60,15 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Pagination<MerchantAuthDTO> getMerchantAuthPaging(@NonNull MerchantAuthPagingParam param) {
|
|
public Pagination<MerchantAuthDTO> getMerchantAuthPaging(@NonNull MerchantAuthPagingParam param) {
|
|
|
|
+ Long userId = null;
|
|
|
|
+ Scope scope = com.chelvc.framework.common.util.StringUtils.ifEmpty(SessionContextHolder.getScope(), Scope::parse);
|
|
|
|
+ if (scope == Scope.ADMIN) {
|
|
|
|
+ }else {
|
|
|
|
+ userId = SessionContextHolder.getId();
|
|
|
|
+ }
|
|
Page<MerchantAuth> page = this.lambdaQuery()
|
|
Page<MerchantAuth> page = this.lambdaQuery()
|
|
.like(StringUtils.notEmpty(param.getStoreName()), MerchantAuth::getStoreName, param.getStoreName())
|
|
.like(StringUtils.notEmpty(param.getStoreName()), MerchantAuth::getStoreName, param.getStoreName())
|
|
|
|
+ .eq(StringUtils.notEmpty(userId),MerchantAuth::getApplicant,userId)
|
|
.orderByAsc(MerchantAuth::getReviewTime).page(DatabaseContextHolder.page(param.getPaging()));
|
|
.orderByAsc(MerchantAuth::getReviewTime).page(DatabaseContextHolder.page(param.getPaging()));
|
|
return DatabaseContextHolder.pagination(page, MerchantAuthCopier.INSTANCE::copying);
|
|
return DatabaseContextHolder.pagination(page, MerchantAuthCopier.INSTANCE::copying);
|
|
}
|
|
}
|
|
@@ -85,6 +95,8 @@ public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, Mer
|
|
merchantAuth.setReviewer(userId.toString());
|
|
merchantAuth.setReviewer(userId.toString());
|
|
merchantAuth.setMessage(message);
|
|
merchantAuth.setMessage(message);
|
|
this.updateById(merchantAuth);
|
|
this.updateById(merchantAuth);
|
|
- this.userService.updateUserRole(merchantAuth.getApplicant());
|
|
|
|
|
|
+ if (StringUtils.notEmpty(state) && "1".equals(state)){
|
|
|
|
+ this.userService.updateUserRole(merchantAuth.getApplicant());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|