Jelajahi Sumber

取消协作

lyhzzz 1 tahun lalu
induk
melakukan
0bf324d42b

+ 0 - 4
src/main/java/com/fdkankan/manage_jp/controller/TmContractorController.java

@@ -48,9 +48,5 @@ public class TmContractorController extends  BaseController{
         return Result.success();
     }
 
-    public static void main(String[] args) {
-    }
-
-
 }
 

+ 2 - 0
src/main/java/com/fdkankan/manage_jp/service/ITmContractorNumService.java

@@ -22,4 +22,6 @@ public interface ITmContractorNumService extends IService<TmContractorNum> {
     List<TmContractorNum> getByContractorIds(List<Integer> ids);
 
     List<String> getNumListByCompanyId(Long companyId);
+
+    void deleteByContractorIdAndNumList(Integer id, List<String> numList);
 }

+ 11 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/TmContractorNumServiceImpl.java

@@ -66,4 +66,15 @@ public class TmContractorNumServiceImpl extends ServiceImpl<ITmContractorNumMapp
         }
         return new ArrayList<>();
     }
+
+    @Override
+    public void deleteByContractorIdAndNumList(Integer id, List<String> numList) {
+        LambdaQueryWrapper<TmContractorNum> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(TmContractorNum::getContractorId,id);
+        if(!numList.isEmpty()){
+            wrapper.in(TmContractorNum::getNum,numList);
+        }
+        this.remove(wrapper);
+
+    }
 }

+ 9 - 1
src/main/java/com/fdkankan/manage_jp/service/impl/TmContractorServiceImpl.java

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -96,7 +97,14 @@ public class TmContractorServiceImpl extends ServiceImpl<ITmContractorMapper, Tm
 
     @Override
     public void unCollaborate(SceneParam param, User user) {
-        //tmContractorNumService.deleteByContractorIdAndNumList(param.getId(),param.getNumList());
+        if(param.getId() == null){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        tmContractorNumService.deleteByContractorIdAndNumList(param.getId(),param.getNumList());
+        List<TmContractorNum> contractorIds = tmContractorNumService.getByContractorIds(Arrays.asList(param.getId()));
+        if(contractorIds.size() <=0){
+            this.removeById(param.getId());
+        }
     }
 
     private TmContractor getByMainContractor(Long userId, Long userId2) {

+ 0 - 48
src/main/java/com/fdkankan/manage_jp/util/EncryptDecrypt.java

@@ -1,48 +0,0 @@
-package com.fdkankan.manage_jp.util;
-
-
-import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
-import org.jasypt.encryption.pbe.StandardPBEByteEncryptor;
-import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
-import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-/**
- * @author ys
- * @create 2021/9/22
- * @desc Jasypt安全框架加密类工具包
- **/
-public class EncryptDecrypt {
-
-    public static void main(String[] args) {
-        StandardPBEStringEncryptor standardPBEStringEncryptor = new StandardPBEStringEncryptor();
-        //配置文件中配置如下的算法
-        standardPBEStringEncryptor.setAlgorithm("PBEWithMD5AndDES");
-        //配置文件中配置的password
-        standardPBEStringEncryptor.setPassword("4dage168...");
-        //要加密的文本
-        String password = standardPBEStringEncryptor.encrypt("JK20220120%JIK");
-        String name = standardPBEStringEncryptor.encrypt("LTAI5tJZBJwP5qazE6b3b4Gr");
-        String redisPassword = standardPBEStringEncryptor.encrypt("zSQCG0yyvRJISPokNZGhbhaAfh4hGX");
-        String redisPassword1 = standardPBEStringEncryptor.encrypt("admin");
-        String redisPassword2 = standardPBEStringEncryptor.encrypt("admin1231");
-        //将加密的文本写到配置文件中
-        System.out.println("name=" + name);
-        System.out.println("password=" + password);
-        System.out.println("redisPassword=" + redisPassword);
-        System.out.println("redisPassword=" + redisPassword1);
-        System.out.println("redisPassword=" + redisPassword2);
-
-        //要解密的文本
-        //String name2 = standardPBEStringEncryptor.decrypt("FarrmxSQX5uwtH/NZRxy+g==");
-        //String password2 = standardPBEStringEncryptor.decrypt("vhiaYB1gl9zPj16yu7uMkA==");
-       // String redisPassword2 = standardPBEStringEncryptor.decrypt("ZII7UphhbVuJ8c3oxPUeyw==");
-        //解密后的文本
-
-    }
-
-
-}
-