|
@@ -14,6 +14,8 @@ import org.springblade.client.corps.excel.CorpsExcel;
|
|
|
import org.springblade.client.corps.excel.CorpsSupplierExcel;
|
|
import org.springblade.client.corps.excel.CorpsSupplierExcel;
|
|
|
import org.springblade.client.corps.service.ICorpsDescService;
|
|
import org.springblade.client.corps.service.ICorpsDescService;
|
|
|
import org.springblade.client.entity.CorpsDesc;
|
|
import org.springblade.client.entity.CorpsDesc;
|
|
|
|
|
+import org.springblade.client.entity.GoodsDesc;
|
|
|
|
|
+import org.springblade.client.vo.CorpListVo;
|
|
|
import org.springblade.client.vo.CorpsDescVO;
|
|
import org.springblade.client.vo.CorpsDescVO;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springblade.core.datascope.annotation.DataAuth;
|
|
import org.springblade.core.datascope.annotation.DataAuth;
|
|
@@ -280,28 +282,29 @@ public class CorpsDescController extends BladeController {
|
|
|
@GetMapping("/corpsDescList")
|
|
@GetMapping("/corpsDescList")
|
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "所有客户信息", notes = "corpType必填")
|
|
@ApiOperation(value = "所有客户信息", notes = "corpType必填")
|
|
|
- public R<List<CorpsDescVO>> orderList(CorpsDescVO corpsDesc) {
|
|
|
|
|
|
|
+ public R<List<CorpListVo>> orderList(CorpsDescVO corpsDesc) {
|
|
|
if (StringUtils.isBlank(corpsDesc.getCorpType())) {
|
|
if (StringUtils.isBlank(corpsDesc.getCorpType())) {
|
|
|
throw new SecurityException("缺少必要的参数,客户类型");
|
|
throw new SecurityException("缺少必要的参数,客户类型");
|
|
|
}
|
|
}
|
|
|
LambdaQueryWrapper<CorpsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<CorpsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- if (Func.isNotEmpty(corpsDesc.getAdminProfiles())){
|
|
|
|
|
- lambdaQueryWrapper.like(CorpsDesc::getAdminProfiles, corpsDesc.getAdminProfiles());
|
|
|
|
|
- lambdaQueryWrapper.or();
|
|
|
|
|
- lambdaQueryWrapper.eq(CorpsDesc::getAdminProfiles,' ');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(corpsDesc.getCname()), CorpsDesc::getCname, corpsDesc.getCname());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(corpsDesc.getCode()), CorpsDesc::getCode, corpsDesc.getCode());
|
|
|
|
|
+ lambdaQueryWrapper.eq(CorpsDesc::getIsDeleted, 0);
|
|
|
|
|
+ lambdaQueryWrapper.eq(CorpsDesc::getTenantId, SecureUtil.getTenantId());
|
|
|
if ("KG".equals(corpsDesc.getCorpType())) {
|
|
if ("KG".equals(corpsDesc.getCorpType())) {
|
|
|
lambdaQueryWrapper.and(i -> i.like(CorpsDesc::getCorpType, "KH").or().like(CorpsDesc::getCorpType, "GYS"));
|
|
lambdaQueryWrapper.and(i -> i.like(CorpsDesc::getCorpType, "KH").or().like(CorpsDesc::getCorpType, "GYS"));
|
|
|
} else {
|
|
} else {
|
|
|
lambdaQueryWrapper.like(CorpsDesc::getCorpType, corpsDesc.getCorpType());
|
|
lambdaQueryWrapper.like(CorpsDesc::getCorpType, corpsDesc.getCorpType());
|
|
|
}
|
|
}
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(corpsDesc.getCname()), CorpsDesc::getCname, corpsDesc.getCname());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(corpsDesc.getCode()), CorpsDesc::getCode, corpsDesc.getCode());
|
|
|
|
|
- lambdaQueryWrapper.eq(CorpsDesc::getIsDeleted, 0);
|
|
|
|
|
- lambdaQueryWrapper.eq(CorpsDesc::getTenantId, SecureUtil.getTenantId());
|
|
|
|
|
|
|
+ if (Func.isNotEmpty(corpsDesc.getAdminProfiles())){
|
|
|
|
|
+ lambdaQueryWrapper.and(i ->i.like(CorpsDesc::getAdminProfiles,corpsDesc.getAdminProfiles()).or().eq(CorpsDesc::getAdminProfiles,' '));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtils.isNotBlank(corpsDesc.getBelongtocompany())){
|
|
|
|
|
+ lambdaQueryWrapper.and(i ->i.eq(CorpsDesc::getBelongtocompany,corpsDesc.getBelongtocompany()).or().isNull(CorpsDesc::getBelongtocompany));
|
|
|
|
|
+ }
|
|
|
List<CorpsDesc> corpsDescList = corpsDescService.list(lambdaQueryWrapper);
|
|
List<CorpsDesc> corpsDescList = corpsDescService.list(lambdaQueryWrapper);
|
|
|
|
|
|
|
|
- List<CorpsDescVO> voList = BeanUtil.copy(corpsDescList, CorpsDescVO.class);
|
|
|
|
|
|
|
+ List<CorpListVo> voList = BeanUtil.copy(corpsDescList, CorpListVo.class);
|
|
|
voList.forEach(desc -> {
|
|
voList.forEach(desc -> {
|
|
|
if (StringUtils.isNotBlank(desc.getBelongtocompany())) {
|
|
if (StringUtils.isNotBlank(desc.getBelongtocompany())) {
|
|
|
CorpsDesc company = corpsDescService.getById(desc.getBelongtocompany());
|
|
CorpsDesc company = corpsDescService.getById(desc.getBelongtocompany());
|