Compare commits
3 Commits
6153e6e4f1
...
82b86ae86e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82b86ae86e | ||
|
|
3e079850e6 | ||
|
|
62001fbd5f |
@@ -1,7 +1,7 @@
|
|||||||
package com.starry.admin.modules.clerk.module.vo;
|
package com.starry.admin.modules.clerk.module.vo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.starry.admin.modules.clerk.module.enums.ClerkDataType;
|
import com.starry.admin.modules.clerk.module.enums.ClerkDataType;
|
||||||
|
import com.starry.common.enums.ClerkReviewState;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -66,6 +66,12 @@ public class PlayClerkDataReviewReturnVo {
|
|||||||
@ApiModelProperty(value = "审核状态", example = "0", notes = "0:未审核:1:审核通过,2:审核不通过")
|
@ApiModelProperty(value = "审核状态", example = "0", notes = "0:未审核:1:审核通过,2:审核不通过")
|
||||||
private String reviewState;
|
private String reviewState;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态枚举
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "审核状态枚举", example = "APPROVED", notes = "PENDING:未审核, APPROVED:审核通过, REJECTED:审核不通过")
|
||||||
|
private ClerkReviewState reviewStateEnum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资料添加时间
|
* 资料添加时间
|
||||||
*/
|
*/
|
||||||
@@ -123,4 +129,29 @@ public class PlayClerkDataReviewReturnVo {
|
|||||||
return dataTypeEnum;
|
return dataTypeEnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setReviewState(String reviewState) {
|
||||||
|
this.reviewState = reviewState;
|
||||||
|
try {
|
||||||
|
this.reviewStateEnum = ClerkReviewState.fromCode(reviewState);
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.reviewStateEnum = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReviewStateEnum(ClerkReviewState reviewStateEnum) {
|
||||||
|
this.reviewStateEnum = reviewStateEnum;
|
||||||
|
this.reviewState = reviewStateEnum != null ? reviewStateEnum.getCode() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClerkReviewState getReviewStateEnum() {
|
||||||
|
if (reviewStateEnum == null && reviewState != null) {
|
||||||
|
try {
|
||||||
|
reviewStateEnum = ClerkReviewState.fromCode(reviewState);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// ignore invalid code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return reviewStateEnum;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package com.starry.admin.modules.clerk.module.vo;
|
package com.starry.admin.modules.clerk.module.vo;
|
||||||
|
|
||||||
|
import com.starry.common.enums.ClerkReviewState;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Pattern;
|
import javax.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,10 +22,14 @@ public class PlayClerkDataReviewStateEditVo {
|
|||||||
/**
|
/**
|
||||||
* 审核状态(0:未审核:1:审核通过,2:审核不通过)
|
* 审核状态(0:未审核:1:审核通过,2:审核不通过)
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "审核状态不能为空")
|
@NotNull(message = "审核状态不能为空")
|
||||||
@Pattern(regexp = "[12]", message = "审核状态必须为1或2")
|
@ApiModelProperty(
|
||||||
@ApiModelProperty(value = "审核状态", required = true, example = "1", notes = "1:审核通过,2:审核不通过")
|
value = "审核状态",
|
||||||
private String reviewState;
|
required = true,
|
||||||
|
example = "1",
|
||||||
|
allowableValues = "1,2",
|
||||||
|
notes = "1:审核通过,2:审核不通过")
|
||||||
|
private ClerkReviewState reviewState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核内容
|
* 审核内容
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ import com.starry.admin.modules.clerk.module.vo.PlayClerkDataReviewReturnVo;
|
|||||||
import com.starry.admin.modules.clerk.module.vo.PlayClerkDataReviewStateEditVo;
|
import com.starry.admin.modules.clerk.module.vo.PlayClerkDataReviewStateEditVo;
|
||||||
import com.starry.admin.modules.clerk.service.IPlayClerkDataReviewInfoService;
|
import com.starry.admin.modules.clerk.service.IPlayClerkDataReviewInfoService;
|
||||||
import com.starry.admin.modules.clerk.service.IPlayClerkUserInfoService;
|
import com.starry.admin.modules.clerk.service.IPlayClerkUserInfoService;
|
||||||
|
import com.starry.common.enums.ClerkReviewState;
|
||||||
import com.starry.common.utils.IdUtils;
|
import com.starry.common.utils.IdUtils;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -132,9 +132,12 @@ public class PlayClerkDataReviewInfoServiceImpl
|
|||||||
@Override
|
@Override
|
||||||
public void updateDataReviewState(PlayClerkDataReviewStateEditVo vo) {
|
public void updateDataReviewState(PlayClerkDataReviewStateEditVo vo) {
|
||||||
PlayClerkDataReviewInfoEntity entity = this.selectPlayClerkDataReviewInfoById(vo.getId());
|
PlayClerkDataReviewInfoEntity entity = this.selectPlayClerkDataReviewInfoById(vo.getId());
|
||||||
BeanUtils.copyProperties(vo, entity);
|
ClerkReviewState reviewState = vo.getReviewState();
|
||||||
|
entity.setReviewState(reviewState != null ? reviewState.getCode() : null);
|
||||||
|
entity.setReviewCon(vo.getReviewCon());
|
||||||
|
entity.setReviewTime(vo.getReviewTime() != null ? vo.getReviewTime() : LocalDateTime.now());
|
||||||
this.update(entity);
|
this.update(entity);
|
||||||
if ("1".equals(vo.getReviewState())) {
|
if (ClerkReviewState.APPROVED.equals(reviewState)) {
|
||||||
PlayClerkUserInfoEntity userInfo = new PlayClerkUserInfoEntity();
|
PlayClerkUserInfoEntity userInfo = new PlayClerkUserInfoEntity();
|
||||||
userInfo.setId(entity.getClerkId());
|
userInfo.setId(entity.getClerkId());
|
||||||
if ("1".equals(entity.getDataType())) {
|
if ("1".equals(entity.getDataType())) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.starry.admin.modules.clerk.service.impl;
|
package com.starry.admin.modules.clerk.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -91,11 +92,19 @@ public class PlayClerkUserReviewInfoServiceImpl
|
|||||||
lambdaQueryWrapper.like(PlayClerkUserReviewInfoEntity::getPhone, vo.getPhone());
|
lambdaQueryWrapper.like(PlayClerkUserReviewInfoEntity::getPhone, vo.getPhone());
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(vo.getReviewState())) {
|
if (StrUtil.isNotBlank(vo.getReviewState())) {
|
||||||
lambdaQueryWrapper.like(PlayClerkUserReviewInfoEntity::getReviewState, vo.getReviewState());
|
lambdaQueryWrapper.eq(PlayClerkUserReviewInfoEntity::getReviewState, vo.getReviewState());
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(vo.getWeiChatCode())) {
|
if (StrUtil.isNotBlank(vo.getWeiChatCode())) {
|
||||||
lambdaQueryWrapper.like(PlayClerkUserReviewInfoEntity::getWeiChatCode, vo.getWeiChatCode());
|
lambdaQueryWrapper.like(PlayClerkUserReviewInfoEntity::getWeiChatCode, vo.getWeiChatCode());
|
||||||
}
|
}
|
||||||
|
if (CollUtil.isNotEmpty(vo.getAddTime())) {
|
||||||
|
if (vo.getAddTime().size() >= 2) {
|
||||||
|
lambdaQueryWrapper.between(PlayClerkUserReviewInfoEntity::getAddTime, vo.getAddTime().get(0),
|
||||||
|
vo.getAddTime().get(1));
|
||||||
|
} else if (vo.getAddTime().size() == 1) {
|
||||||
|
lambdaQueryWrapper.ge(PlayClerkUserReviewInfoEntity::getAddTime, vo.getAddTime().get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
// 加入组员的筛选
|
// 加入组员的筛选
|
||||||
// List<String> clerkIdList =
|
// List<String> clerkIdList =
|
||||||
// playClerkGroupInfoService.getValidClerkIdList(SecurityUtils.getLoginUser(),
|
// playClerkGroupInfoService.getValidClerkIdList(SecurityUtils.getLoginUser(),
|
||||||
|
|||||||
@@ -15,11 +15,9 @@ import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
|||||||
import com.starry.admin.utils.SecurityUtils;
|
import com.starry.admin.utils.SecurityUtils;
|
||||||
import com.starry.common.utils.ConvertUtil;
|
import com.starry.common.utils.ConvertUtil;
|
||||||
import com.starry.common.utils.IdUtils;
|
import com.starry.common.utils.IdUtils;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
|
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
|
||||||
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
|
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.starry.common.enums;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员资料审核状态枚举,集中维护状态代码及含义。
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "店员资料审核状态", description = "店员资料审核状态枚举,避免魔法值")
|
||||||
|
public enum ClerkReviewState {
|
||||||
|
|
||||||
|
PENDING("0", "未审核"),
|
||||||
|
APPROVED("1", "审核通过"),
|
||||||
|
REJECTED("2", "审核不通过");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
ClerkReviewState(String code, String description) {
|
||||||
|
this.code = code;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonValue
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonCreator
|
||||||
|
public static ClerkReviewState fromCode(String code) {
|
||||||
|
if (code == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ClerkReviewState state : ClerkReviewState.values()) {
|
||||||
|
if (state.code.equals(code)) {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Unknown ClerkReviewState code: " + code);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user