From 5dfd0610ccf465126701292fabbd665c2f2f5d50 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期二, 15 七月 2025 12:07:20 +0800
Subject: [PATCH] 111
---
server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java | 38 +++++++++++++++++++++++++++++++++++++-
1 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java
index a23d9d5..0961efe 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java
@@ -6,6 +6,7 @@
import com.doumee.core.constants.Constants;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
+import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Utils;
@@ -13,6 +14,7 @@
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.model.IdentityInfo;
import com.doumee.dao.business.model.Member;
+import com.doumee.dao.dto.AuditDTO;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.IdentityInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -21,9 +23,12 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.swagger.annotations.ApiModelProperty;
+import nonapi.io.github.classgraph.json.Id;
import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
@@ -367,8 +372,39 @@
}
- public void audit(){
+ @Override
+ @Transactional(rollbackFor = {BusinessException.class,Exception.class})
+ public void audit(AuditDTO auditDTO){
+ if(Objects.isNull(auditDTO)
+ || Objects.isNull(auditDTO.getId())
+ || Objects.isNull(auditDTO.getAuditStatus())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+ IdentityInfo identityInfo = identityInfoMapper.selectById(auditDTO.getId());
+ if(Objects.isNull(identityInfo)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ }
+ if(!Constants.equalsInteger(identityInfo.getAuditStatus(),Constants.ONE)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"宸插鎵癸紝璇峰嬁閲嶅鎿嶄綔");
+ }
+ identityInfoMapper.update(new UpdateWrapper<IdentityInfo>().lambda()
+ .set(IdentityInfo::getAuditStatus,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE)
+ .set(StringUtils.isNotBlank(auditDTO.getAuditRemark()),IdentityInfo::getAuditRemark,auditDTO.getAuditRemark())
+ .set(IdentityInfo::getAuditTime,"now()")
+ .set(IdentityInfo::getUpdateUser,user.getId())
+ .set(IdentityInfo::getUpdateTime,"now()")
+ .eq(IdentityInfo::getId,identityInfo.getId())
+ );
+ memberMapper.update(new UpdateWrapper<Member>().lambda()
+ .set(Member::getUpdateUser,user.getId())
+ .set(Member::getUpdateTime,"now()")
+ .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE)
+ .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE)
+ .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE)
+ .eq(Member::getId,identityInfo.getMemberId())
+ );
}
--
Gitblit v1.9.3