From 45091e34fb6e50ddac36d017947e2185619c641a Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 09 十月 2024 16:16:08 +0800
Subject: [PATCH] 代码初始化
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java
index e9b3d38..ad482b6 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java
@@ -11,10 +11,7 @@
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
-import com.doumee.dao.business.ApproveTemplMapper;
-import com.doumee.dao.business.MemberMapper;
-import com.doumee.dao.business.PlatformBooksMapper;
-import com.doumee.dao.business.PlatformReasonMapper;
+import com.doumee.dao.business.*;
import com.doumee.dao.business.join.ApproveJoinMapper;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.ApproveDataVO;
@@ -63,6 +60,9 @@
private PlatformReasonMapper platformReasonMapper;
@Autowired
+ private PlatformGroupMapper platformGroupMapper;
+
+ @Autowired
private SystemDictDataBiz systemDictDataBiz;
@Autowired
@@ -73,6 +73,9 @@
@Autowired
private ApproveJoinMapper approveJoinMapper;
+
+ @Autowired
+ private CarsMapper carsMapper;
@Override
@@ -169,7 +172,7 @@
;
PageData<PlatformBooks> pageData = PageData.from(platformBooksMapper.selectPage(page, queryWrapper));
for (PlatformBooks platformBooks:pageData.getRecords()) {
- if(Constants.equalsInteger(platformBooks.getStatus(),Constants.ONE)){
+ if(Constants.equalsInteger(platformBooks.getStatus(),Constants.ONE)||Constants.equalsInteger(platformBooks.getStatus(),Constants.ZERO)){
String auditName = approveService.getApproveUserName(platformBooks.getId(),Constants.approveObjectType.reason);
platformBooks.setAuditName(auditName);
}
@@ -241,6 +244,17 @@
if(Objects.isNull(platformReason)|| !Constants.equalsInteger(platformReason.getIsdeleted(),Constants.ZERO)){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍏ュ洯鍘熷洜淇℃伅寮傚父,璇峰埛鏂伴噸璇�");
}
+ PlatformGroup platformGroup= platformGroupMapper.selectById(platformReason.getGroupId());
+ if(Objects.isNull(platformGroup)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌缁戝畾鏈堝彴缁勬暟鎹�");
+ }
+ if(!Constants.equalsInteger(platformGroup.getIsdeleted(),Constants.ZERO)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"缁戝畾鏈堝彴缁勬暟鎹紓甯革紝璇疯仈绯荤鐞嗗憳");
+ }
+ //鏌ヨ杞﹁締鏄惁涓鸿嚜鏈夎溅
+ if(carsMapper.selectCount(new QueryWrapper<Cars>().lambda().eq(Cars::getIsdeleted,Constants.ZERO).eq(Cars::getCode,platformBooksApplyDTO.getCarCodeFront()))>Constants.ZERO){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"["+platformBooksApplyDTO.getCarCodeFront()+"]灞炰簬鍐呴儴杞﹁締锛屾棤娉曢绾�");
+ };
ApproveTempl approveTempl = approveTemplMapper.selectById(platformReason.getId());
if(Objects.isNull(approveTempl)){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏈厤缃鎵规祦,璇疯仈绯荤鐞嗗憳");
@@ -282,6 +296,10 @@
){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
+ //鏌ヨ杞﹁締鏄惁涓鸿嚜鏈夎溅
+ if(carsMapper.selectCount(new QueryWrapper<Cars>().lambda().eq(Cars::getIsdeleted,Constants.ZERO).eq(Cars::getCode,platformBooksApplyDTO.getCarCodeFront()))>Constants.ZERO){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"["+platformBooksApplyDTO.getCarCodeFront()+"]灞炰簬鍐呴儴杞﹁締锛屾棤娉曢绾�");
+ };
PlatformBooks platformBooks = platformBooksMapper.selectById(platformBooksApplyDTO.getId());
if(Objects.isNull(platformBooks)){
throw new BusinessException(ResponseStatus.DATA_EMPTY);
--
Gitblit v1.9.3