|
@@ -13,9 +13,12 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
|
|
|
|
+import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@@ -33,6 +36,9 @@ public class TCorpsServiceImpl implements ITCorpsService {
|
|
@Autowired
|
|
@Autowired
|
|
private TCustomerContactMapper tCustomerContactMapper;
|
|
private TCustomerContactMapper tCustomerContactMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private TWarehouseBillsMapper tWarehouseBillsMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询客户详情
|
|
* 查询客户详情
|
|
*
|
|
*
|
|
@@ -131,8 +137,23 @@ public class TCorpsServiceImpl implements ITCorpsService {
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public int deleteTCorpsByIds(Long[] fIds) {
|
|
|
|
- return tCorpsMapper.deleteTCorpsByIds(fIds);
|
|
|
|
|
|
+ @Transactional
|
|
|
|
+ public AjaxResult deleteTCorpsByIds(Long[] fIds) {
|
|
|
|
+ //return tCorpsMapper.deleteTCorpsByIds(fIds);
|
|
|
|
+ // 查询仓库主表 是否有客户存在
|
|
|
|
+ int i = 1;
|
|
|
|
+ for(Long id:fIds){
|
|
|
|
+ TWarehouseBills tWarehouseBill =new TWarehouseBills();
|
|
|
|
+ tWarehouseBill.setfCorpid(id);
|
|
|
|
+ List<TWarehouseBills> tWarehouseBillList=tWarehouseBillsMapper.selectTWarehousebillsList(tWarehouseBill);
|
|
|
|
+ if(tWarehouseBillList!=null && !tWarehouseBillList.isEmpty()){
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
|
+ return AjaxResult.error("客户第" + i + "行仓库有货物不可删除");
|
|
|
|
+ }
|
|
|
|
+ tCorpsMapper.deleteTCorpsById(id);
|
|
|
|
+ i++;
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|