| 
					
				 | 
			
			
				@@ -68,6 +68,7 @@ public class UserLogic { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private final UserCompanyCreditService userCompanyCreditService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private final StorageService storageService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private final UserCompanyDeliveryRelaService userCompanyDeliveryRelaService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private final UserCompanyCreditBillItemService userCompanyCreditBillItemService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 客户列表-v2 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -657,15 +658,33 @@ public class UserLogic { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .update(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Transactional 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void companyCreditDel(String userId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         AdminUserCom adminUser = commonLogic.getAdminUser(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // TODO 需要检查是否已产生授信数据或未还款账单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        final Integer count = userCompanyCreditBillItemService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(UserCompanyCreditBillItem::getUserId, userId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(UserCompanyCreditBillItem::getCompanyWechatId, adminUser.getCompanyWechatId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .count(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (count > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new RemoteServiceException("已产生授信三级账明细, 不能删除"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        final UserCompanyCredit companyCredit = userCompanyCreditService.lambdaQuery() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(UserCompanyCredit::getUserId, userId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(UserCompanyCredit::getCompanyWechatId, adminUser.getCompanyWechatId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .one(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        userCompanyDeliveryService.lambdaUpdate() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                .eq(UserCompanyDelivery::getUserId, userId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                .eq(UserCompanyDelivery::getCompanyWechatId, adminUser.getCompanyWechatId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                .remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (companyCredit.getIsCreditEnabled()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new RemoteServiceException("未关闭授信, 不能删除"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 检查是否已产生授信数据或未还款账单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        userCompanyCreditService.lambdaUpdate() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(UserCompanyCredit::getUserId, userId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(UserCompanyCredit::getCompanyWechatId, adminUser.getCompanyWechatId()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .remove(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |