|
@@ -11,6 +11,7 @@ import cn.ezhizao.project.business.outsourceBalanceAccount.service.IBizOutsource
|
|
import cn.ezhizao.project.business.supplier.domain.*;
|
|
import cn.ezhizao.project.business.supplier.domain.*;
|
|
import cn.ezhizao.project.business.supplier.service.*;
|
|
import cn.ezhizao.project.business.supplier.service.*;
|
|
import cn.ezhizao.project.system.domain.SysDept;
|
|
import cn.ezhizao.project.system.domain.SysDept;
|
|
|
|
+import cn.ezhizao.project.system.service.ISysConfigService;
|
|
import cn.ezhizao.project.system.service.ISysDeptService;
|
|
import cn.ezhizao.project.system.service.ISysDeptService;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
@@ -49,6 +50,8 @@ public class BizSupplierController extends BaseController {
|
|
private ISysDeptService sysDeptService;
|
|
private ISysDeptService sysDeptService;
|
|
@Resource
|
|
@Resource
|
|
private HttpServletRequest request;
|
|
private HttpServletRequest request;
|
|
|
|
+ @Resource
|
|
|
|
+ private ISysConfigService configService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询外协商列表
|
|
* 查询外协商列表
|
|
@@ -57,10 +60,12 @@ public class BizSupplierController extends BaseController {
|
|
@Log(title = "外协商单位查询", businessType = BusinessType.SELECT)
|
|
@Log(title = "外协商单位查询", businessType = BusinessType.SELECT)
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
public TableDataInfo list(BizSupplier data) throws NoSuchFieldException, IllegalAccessException, JsonProcessingException {
|
|
public TableDataInfo list(BizSupplier data) throws NoSuchFieldException, IllegalAccessException, JsonProcessingException {
|
|
-// String tenantId = request.getHeader("tenantId");
|
|
|
|
-// if (tenantId != null && !"0".equals(tenantId)) {
|
|
|
|
-// data.setTenantId(Long.parseLong(tenantId));
|
|
|
|
-// }
|
|
|
|
|
|
+
|
|
|
|
+ String config = configService.selectConfigByKey("switch_data_source");
|
|
|
|
+ String tenantId = request.getHeader("tenantId");
|
|
|
|
+ if ("true".equals(config) && tenantId != null && !"0".equals(tenantId)) {
|
|
|
|
+ data.setTenantId(Long.parseLong(tenantId));
|
|
|
|
+ }
|
|
startPage();
|
|
startPage();
|
|
List<BizSupplier> list = iBizSupplierService.getList(data);
|
|
List<BizSupplier> list = iBizSupplierService.getList(data);
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
@@ -105,11 +110,11 @@ public class BizSupplierController extends BaseController {
|
|
queryWrapper.eq("tenant_id", Long.valueOf(tenantId));
|
|
queryWrapper.eq("tenant_id", Long.valueOf(tenantId));
|
|
queryWrapper.eq("name", bizSupplier.getName());
|
|
queryWrapper.eq("name", bizSupplier.getName());
|
|
if(bizSupplier.getId() == null) {
|
|
if(bizSupplier.getId() == null) {
|
|
- List<BizSupplier> supplierList = iBizSupplierService.query().eq("code", bizSupplier.getCode()).list();
|
|
|
|
|
|
+ List<BizSupplier> supplierList = iBizSupplierService.query().eq("code", bizSupplier.getCode()).eq("tenant_id", tenantId).list();
|
|
if (!supplierList.isEmpty()) {
|
|
if (!supplierList.isEmpty()) {
|
|
return AjaxResult.error("供应商编号不能重复");
|
|
return AjaxResult.error("供应商编号不能重复");
|
|
}
|
|
}
|
|
- supplierList = iBizSupplierService.query().eq("mnemonic_code", bizSupplier.getMnemonicCode()).list();
|
|
|
|
|
|
+ supplierList = iBizSupplierService.query().eq("mnemonic_code", bizSupplier.getMnemonicCode()).eq("tenant_id", tenantId).list();
|
|
if (!supplierList.isEmpty()) {
|
|
if (!supplierList.isEmpty()) {
|
|
return AjaxResult.error("助记码不能重复");
|
|
return AjaxResult.error("助记码不能重复");
|
|
}
|
|
}
|