|
|
@@ -429,4 +429,57 @@ public class BCorpsController extends BladeController {
|
|
|
return R.data(pages);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页 物流-基础资料-往来单位
|
|
|
+ */
|
|
|
+ @GetMapping("/listAll")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "分页", notes = "传入bCorps")
|
|
|
+ public R<List<BCorps>> list(BCorps bCorps) {
|
|
|
+ LambdaQueryWrapper<BCorps> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(BCorps::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(BCorps::getIsDeleted, 0)
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getCode()), BCorps::getCode, bCorps.getCode())
|
|
|
+ .eq(ObjectUtils.isNotNull(bCorps.getStatus()), BCorps::getStatus, bCorps.getStatus())
|
|
|
+ .and(ObjectUtils.isNotNull(bCorps.getCnName()), i -> i.like(BCorps::getCnName, bCorps.getCnName()).or()
|
|
|
+ .like(BCorps::getEnName, bCorps.getCnName()).or().like(BCorps::getCode, bCorps.getCnName()))
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getShortName()), BCorps::getShortName, bCorps.getShortName())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getEnName()), BCorps::getEnName, bCorps.getEnName())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getUscc()), BCorps::getUscc, bCorps.getUscc())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getCnAddr()), BCorps::getCnAddr, bCorps.getCnAddr())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getCnAddr()), BCorps::getCnAddr, bCorps.getCnAddr())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getEnAddr()), BCorps::getEnAddr, bCorps.getEnAddr())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getCntyCode()), BCorps::getCntyCode, bCorps.getCntyCode())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getCntyName()), BCorps::getCntyName, bCorps.getCntyName())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getCorpSource()), BCorps::getCorpSource, bCorps.getCorpSource())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getTel()), BCorps::getTel, bCorps.getTel())
|
|
|
+ .like(ObjectUtils.isNotNull(bCorps.getAdminProfiles()), BCorps::getAdminProfiles, bCorps.getAdminProfiles());
|
|
|
+ LambdaQueryWrapper<BCorpsTypeDefine> typeDefineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ typeDefineLambdaQueryWrapper.eq(BCorpsTypeDefine::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(BCorpsTypeDefine::getIsDeleted, 0);
|
|
|
+ typeDefineLambdaQueryWrapper.eq(BCorpsTypeDefine::getCorpType, "PS客户");
|
|
|
+ BCorpsTypeDefine typeDefine = bCorpsTypeDefineService.getOne(typeDefineLambdaQueryWrapper);
|
|
|
+ if ("1".equals(bCorps.getType())) {
|
|
|
+ if (typeDefine != null) {
|
|
|
+ lambdaQueryWrapper.apply("find_in_set('" + typeDefine.getId() + "',corp_type)");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (typeDefine != null) {
|
|
|
+ lambdaQueryWrapper.ne(BCorps::getCorpType, typeDefine.getId());
|
|
|
+ }
|
|
|
+ lambdaQueryWrapper.apply(ObjectUtils.isNotNull(bCorps.getCorpType()), "find_in_set('" + bCorps.getCorpType() + "',corp_type)");
|
|
|
+ }
|
|
|
+ String status = sysClient.getParamServiceNew("basic.data.sort");
|
|
|
+ if ("name".equals(status)) {
|
|
|
+ lambdaQueryWrapper.orderByDesc(BCorps::getCnName);
|
|
|
+ } else if ("letter".equals(status)) {
|
|
|
+ lambdaQueryWrapper.orderByDesc(BCorps::getCode);
|
|
|
+ } else {
|
|
|
+ lambdaQueryWrapper.orderByDesc(BCorps::getCreateTime);
|
|
|
+ }
|
|
|
+ List<BCorps> pages = bCorpsService.list( lambdaQueryWrapper);
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
}
|