From da5a270302880181d5c7fe790d9c024215aa9ef1 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 15 七月 2025 11:51:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/services/src/main/java/com/doumee/service/business/impl/IdentityInfoServiceImpl.java | 67 +++++++++++++++++++++++++++------
1 files changed, 54 insertions(+), 13 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 8aa7f58..68dd284 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;
@@ -281,7 +286,7 @@
queryWrapper.le(IdentityInfo::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime()));
}
if (pageWrap.getModel().getRemark() != null) {
- queryWrapper.eq(IdentityInfo::getRemark, pageWrap.getModel().getRemark());
+ queryWrapper.like(IdentityInfo::getRemark, pageWrap.getModel().getRemark());
}
if (pageWrap.getModel().getType() != null) {
queryWrapper.eq(IdentityInfo::getType, pageWrap.getModel().getType());
@@ -293,16 +298,16 @@
queryWrapper.eq(IdentityInfo::getAuthType, pageWrap.getModel().getAuthType());
}
if (pageWrap.getModel().getLinkName() != null) {
- queryWrapper.eq(IdentityInfo::getLinkName, pageWrap.getModel().getLinkName());
+ queryWrapper.like(IdentityInfo::getLinkName, pageWrap.getModel().getLinkName());
}
if (pageWrap.getModel().getTelephone() != null) {
- queryWrapper.eq(IdentityInfo::getTelephone, pageWrap.getModel().getTelephone());
+ queryWrapper.like(IdentityInfo::getTelephone, pageWrap.getModel().getTelephone());
}
if (pageWrap.getModel().getLocation() != null) {
- queryWrapper.eq(IdentityInfo::getLocation, pageWrap.getModel().getLocation());
+ queryWrapper.like(IdentityInfo::getLocation, pageWrap.getModel().getLocation());
}
if (pageWrap.getModel().getCompanyName() != null) {
- queryWrapper.eq(IdentityInfo::getCompanyName, pageWrap.getModel().getCompanyName());
+ queryWrapper.like(IdentityInfo::getCompanyName, pageWrap.getModel().getCompanyName());
}
if (pageWrap.getModel().getLat() != null) {
queryWrapper.eq(IdentityInfo::getLat, pageWrap.getModel().getLat());
@@ -318,15 +323,10 @@
queryWrapper.le(IdentityInfo::getAuditTime, Utils.Date.getEnd(pageWrap.getModel().getAuditTime()));
}
if (pageWrap.getModel().getAuditRemark() != null) {
- queryWrapper.eq(IdentityInfo::getAuditRemark, pageWrap.getModel().getAuditRemark());
+ queryWrapper.like(IdentityInfo::getAuditRemark, pageWrap.getModel().getAuditRemark());
}
- for(PageWrap.SortData sortData: pageWrap.getSorts()) {
- if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
- queryWrapper.orderByDesc(sortData.getProperty());
- } else {
- queryWrapper.orderByAsc(sortData.getProperty());
- }
- }
+ queryWrapper.orderByAsc(IdentityInfo::getAuditStatus );
+ queryWrapper.orderByDesc(IdentityInfo::getCreateTime );
PageData<IdentityInfo> result = PageData.from(identityInfoMapper.selectJoinPage(page,IdentityInfo.class, queryWrapper));
if(result!=null && result.getRecords()!=null){
String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
@@ -365,4 +365,45 @@
QueryWrapper<IdentityInfo> wrapper = new QueryWrapper<>(identityInfo);
return identityInfoMapper.selectCount(wrapper);
}
+
+
+ @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.nonNull(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