From 552dcd8d48b4de12046ec90e7e908493b26b4336 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 08 十月 2024 09:48:07 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 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 c3b471d..c3de7e7 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;
@@ -73,6 +70,9 @@
 
     @Autowired
     private ApproveJoinMapper approveJoinMapper;
+
+    @Autowired
+    private CarsMapper carsMapper;
 
 
     @Override
@@ -241,6 +241,10 @@
         if(Objects.isNull(platformReason)|| !Constants.equalsInteger(platformReason.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 +286,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