|
@@ -17,25 +17,22 @@
|
|
|
package org.springblade.mocha.controller;
|
|
package org.springblade.mocha.controller;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
|
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
-
|
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
-import javax.validation.Valid;
|
|
|
|
|
-
|
|
|
|
|
import org.springblade.client.entity.CorpsDesc;
|
|
import org.springblade.client.entity.CorpsDesc;
|
|
|
-import org.springblade.client.entity.FeesDesc;
|
|
|
|
|
import org.springblade.client.entity.GoodsDesc;
|
|
import org.springblade.client.entity.GoodsDesc;
|
|
|
import org.springblade.client.entity.GoodsSpecification;
|
|
import org.springblade.client.entity.GoodsSpecification;
|
|
|
import org.springblade.client.feign.ICorpsDescClient;
|
|
import org.springblade.client.feign.ICorpsDescClient;
|
|
|
import org.springblade.client.feign.IGoodsDescClient;
|
|
import org.springblade.client.feign.IGoodsDescClient;
|
|
|
import org.springblade.client.feign.IRedisClient;
|
|
import org.springblade.client.feign.IRedisClient;
|
|
|
import org.springblade.client.vo.GoodsDescVO;
|
|
import org.springblade.client.vo.GoodsDescVO;
|
|
|
|
|
+import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springblade.core.excel.util.ExcelUtil;
|
|
import org.springblade.core.excel.util.ExcelUtil;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
@@ -45,17 +42,18 @@ import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.mocha.entity.GoodsSpecificationDto;
|
|
import org.springblade.mocha.entity.GoodsSpecificationDto;
|
|
|
|
|
+import org.springblade.mocha.entity.PriceBank;
|
|
|
import org.springblade.mocha.excel.PriceBankExcel;
|
|
import org.springblade.mocha.excel.PriceBankExcel;
|
|
|
|
|
+import org.springblade.mocha.service.IPriceBankService;
|
|
|
|
|
+import org.springblade.mocha.vo.PriceBankVO;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
-import org.springblade.mocha.entity.PriceBank;
|
|
|
|
|
-import org.springblade.mocha.vo.PriceBankVO;
|
|
|
|
|
-import org.springblade.mocha.service.IPriceBankService;
|
|
|
|
|
-import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import javax.validation.Valid;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -97,22 +95,22 @@ public class PriceBankController extends BladeController {
|
|
|
@ApiOperation(value = "分页", notes = "传入priceBank")
|
|
@ApiOperation(value = "分页", notes = "传入priceBank")
|
|
|
public R<IPage<PriceBank>> list(PriceBankVO priceBank, Query query) {
|
|
public R<IPage<PriceBank>> list(PriceBankVO priceBank, Query query) {
|
|
|
LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getIsDeleted,0);
|
|
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getStatus,0);
|
|
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getIsDeleted, 0);
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getStatus, 0);
|
|
|
lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
|
|
lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getTradeType,"CK");
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()),PriceBank::getCname,priceBank.getCname());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()),PriceBank::getCode,priceBank.getCode());
|
|
|
|
|
- lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()),PriceBank::getCorpId,priceBank.getCorpId());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()),PriceBank::getSpecs,priceBank.getSpecs());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getEname()),PriceBank::getEname,priceBank.getEname());
|
|
|
|
|
- lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()),PriceBank::getEndTime,priceBank.getStatusTime());
|
|
|
|
|
- lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()),PriceBank::getBillType,priceBank.getBillType());
|
|
|
|
|
- lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getDateValidityStart()),PriceBank::getEndTime,priceBank.getDateValidityStart());
|
|
|
|
|
- lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getDateValidityEnd()),PriceBank::getEndTime,priceBank.getDateValidityEnd());
|
|
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getTradeType, "CK");
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()), PriceBank::getCname, priceBank.getCname());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()), PriceBank::getCode, priceBank.getCode());
|
|
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()), PriceBank::getCorpId, priceBank.getCorpId());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()), PriceBank::getSpecs, priceBank.getSpecs());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getEname()), PriceBank::getEname, priceBank.getEname());
|
|
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()), PriceBank::getEndTime, priceBank.getStatusTime());
|
|
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()), PriceBank::getBillType, priceBank.getBillType());
|
|
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getDateValidityStart()), PriceBank::getEndTime, priceBank.getDateValidityStart());
|
|
|
|
|
+ lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getDateValidityEnd()), PriceBank::getEndTime, priceBank.getDateValidityEnd());
|
|
|
lambdaQueryWrapper.orderByDesc(PriceBank::getId);
|
|
lambdaQueryWrapper.orderByDesc(PriceBank::getId);
|
|
|
IPage<PriceBank> pages = priceBankService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
IPage<PriceBank> pages = priceBankService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
|
- if (CollectionUtils.isNotEmpty(pages.getRecords())){
|
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(pages.getRecords())) {
|
|
|
for (PriceBank item : pages.getRecords()) {
|
|
for (PriceBank item : pages.getRecords()) {
|
|
|
R<GoodsDescVO> goodsDesc = goodsDescClient.selectGoodsMessage(item.getItemId());
|
|
R<GoodsDescVO> goodsDesc = goodsDescClient.selectGoodsMessage(item.getItemId());
|
|
|
if (goodsDesc != null && goodsDesc.getData() != null) {
|
|
if (goodsDesc != null && goodsDesc.getData() != null) {
|
|
@@ -120,7 +118,7 @@ public class PriceBankController extends BladeController {
|
|
|
}
|
|
}
|
|
|
if (item.getCorpId() != null) {
|
|
if (item.getCorpId() != null) {
|
|
|
R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(item.getCorpId());
|
|
R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(item.getCorpId());
|
|
|
- if (corpMessage.isSuccess() && corpMessage.getData() != null){
|
|
|
|
|
|
|
+ if (corpMessage.isSuccess() && corpMessage.getData() != null) {
|
|
|
item.setCorpCode(corpMessage.getData().getCode());
|
|
item.setCorpCode(corpMessage.getData().getCode());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -140,24 +138,24 @@ public class PriceBankController extends BladeController {
|
|
|
LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
if (priceBank.getGoodTypeId() != null) {
|
|
if (priceBank.getGoodTypeId() != null) {
|
|
|
List<Long> goodTypeMessage = corpsDescClient.getGoodTypeMessage(priceBank.getGoodTypeId());
|
|
List<Long> goodTypeMessage = corpsDescClient.getGoodTypeMessage(priceBank.getGoodTypeId());
|
|
|
- if (CollectionUtils.isNotEmpty(goodTypeMessage)){
|
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(goodTypeMessage)) {
|
|
|
lambdaQueryWrapper.in(PriceBank::getGoodTypeId, goodTypeMessage);
|
|
lambdaQueryWrapper.in(PriceBank::getGoodTypeId, goodTypeMessage);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getIsDeleted,0);
|
|
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getStatus,0);
|
|
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getIsDeleted, 0);
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getStatus, 0);
|
|
|
lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
|
|
lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getTradeType,"CK");
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()),PriceBank::getCname,priceBank.getCname());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()),PriceBank::getCode,priceBank.getCode());
|
|
|
|
|
- lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()),PriceBank::getCorpId,priceBank.getCorpId());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()),PriceBank::getSpecs,priceBank.getSpecs());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getGoodsTypeName()),PriceBank::getGoodsTypeName,priceBank.getGoodsTypeName());
|
|
|
|
|
- lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()),PriceBank::getEndTime,priceBank.getStatusTime());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getEname()),PriceBank::getEname,priceBank.getEname());
|
|
|
|
|
- lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getDateValidityStart()),PriceBank::getEndTime,priceBank.getDateValidityStart());
|
|
|
|
|
- lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getDateValidityEnd()),PriceBank::getEndTime,priceBank.getDateValidityEnd());
|
|
|
|
|
- lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()),PriceBank::getBillType,priceBank.getBillType());
|
|
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getTradeType, "CK");
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()), PriceBank::getCname, priceBank.getCname());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()), PriceBank::getCode, priceBank.getCode());
|
|
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()), PriceBank::getCorpId, priceBank.getCorpId());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()), PriceBank::getSpecs, priceBank.getSpecs());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getGoodsTypeName()), PriceBank::getGoodsTypeName, priceBank.getGoodsTypeName());
|
|
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()), PriceBank::getEndTime, priceBank.getStatusTime());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getEname()), PriceBank::getEname, priceBank.getEname());
|
|
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getDateValidityStart()), PriceBank::getEndTime, priceBank.getDateValidityStart());
|
|
|
|
|
+ lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getDateValidityEnd()), PriceBank::getEndTime, priceBank.getDateValidityEnd());
|
|
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()), PriceBank::getBillType, priceBank.getBillType());
|
|
|
lambdaQueryWrapper.orderByDesc(PriceBank::getId);
|
|
lambdaQueryWrapper.orderByDesc(PriceBank::getId);
|
|
|
|
|
|
|
|
if (!"admin".equals(AuthUtil.getUserName())) {
|
|
if (!"admin".equals(AuthUtil.getUserName())) {
|
|
@@ -167,24 +165,41 @@ public class PriceBankController extends BladeController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
IPage<PriceBank> pages = priceBankService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
IPage<PriceBank> pages = priceBankService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
|
- if (CollectionUtils.isNotEmpty(pages.getRecords())){
|
|
|
|
|
- pages.getRecords().stream().forEach(item ->{
|
|
|
|
|
- R<GoodsDescVO> goodsDesc = goodsDescClient.selectGoodsMessage(item.getItemId());
|
|
|
|
|
- if (goodsDesc != null && goodsDesc.getData() != null){
|
|
|
|
|
- item.setCnameDescription(goodsDesc.getData().getCnameDescription());
|
|
|
|
|
|
|
+ StringBuilder goodsIds = new StringBuilder();
|
|
|
|
|
+ StringBuilder corpIds = new StringBuilder();
|
|
|
|
|
+ List<GoodsDesc> goodsDescList = new ArrayList<>();
|
|
|
|
|
+ List<CorpsDesc> corpDescList = new ArrayList<>();
|
|
|
|
|
+ List<Long> goodsIdsList = new ArrayList<>();
|
|
|
|
|
+ List<GoodsSpecification> goodsSpecificationList = new ArrayList<>();
|
|
|
|
|
+ for (PriceBank item : pages.getRecords()) {
|
|
|
|
|
+ goodsIds.append(item.getItemId()).append(",");
|
|
|
|
|
+ corpIds.append(item.getCorpId()).append(",");
|
|
|
|
|
+ goodsIdsList.add(item.getItemId());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (goodsIds.length() > 0) {
|
|
|
|
|
+ String ids = goodsIds.substring(0, goodsIds.length() - 1);
|
|
|
|
|
+ goodsDescList = goodsDescClient.selectItemsIdGoods(ids);
|
|
|
|
|
+ goodsSpecificationList = goodsDescClient.goodsSpecificationLists(goodsIdsList);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (corpIds.length() > 0) {
|
|
|
|
|
+ String ids = corpIds.substring(0, corpIds.length() - 1);
|
|
|
|
|
+ corpDescList = corpsDescClient.selectByCorpIds(ids);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(pages.getRecords())) {
|
|
|
|
|
+ for (PriceBank item : pages.getRecords()) {
|
|
|
|
|
+ GoodsDesc goodsDesc = goodsDescList.stream().filter(e -> e.getId().equals(item.getItemId())).findFirst().orElse(null);
|
|
|
|
|
+ if (goodsDesc != null) {
|
|
|
|
|
+ item.setCnameDescription(goodsDesc.getCnameDescription());
|
|
|
}
|
|
}
|
|
|
- if (item.getCorpId() != null) {
|
|
|
|
|
- R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(item.getCorpId());
|
|
|
|
|
- if (corpMessage.isSuccess() && corpMessage.getData() != null){
|
|
|
|
|
- item.setCorpCode(corpMessage.getData().getCode());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ CorpsDesc corpsDesc = corpDescList.stream().filter(e -> e.getId().equals(item.getCorpId())).findFirst().orElse(null);
|
|
|
|
|
+ if (corpsDesc != null) {
|
|
|
|
|
+ item.setCorpCode(corpsDesc.getCode());
|
|
|
}
|
|
}
|
|
|
- List<GoodsSpecification> goodsSpecificationList = goodsDescClient.goodsSpecificationList(item.getItemId());
|
|
|
|
|
- List<GoodsSpecificationDto> goodsSpecificationDtoList = BeanUtil.copy(goodsSpecificationList, GoodsSpecificationDto.class);
|
|
|
|
|
|
|
+ List<GoodsSpecification> list = goodsSpecificationList.stream().filter(e -> e.getPid().equals(item.getItemId())).collect(Collectors.toList());
|
|
|
|
|
+ List<GoodsSpecificationDto> goodsSpecificationDtoList = BeanUtil.copy(list, GoodsSpecificationDto.class);
|
|
|
item.setGoodsSpecificationList(goodsSpecificationDtoList);
|
|
item.setGoodsSpecificationList(goodsSpecificationDtoList);
|
|
|
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return R.data(pages);
|
|
return R.data(pages);
|
|
|
}
|
|
}
|
|
@@ -199,24 +214,24 @@ public class PriceBankController extends BladeController {
|
|
|
LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
if (priceBank.getGoodTypeId() != null) {
|
|
if (priceBank.getGoodTypeId() != null) {
|
|
|
List<Long> goodTypeMessage = corpsDescClient.getGoodTypeMessage(priceBank.getGoodTypeId());
|
|
List<Long> goodTypeMessage = corpsDescClient.getGoodTypeMessage(priceBank.getGoodTypeId());
|
|
|
- if (CollectionUtils.isNotEmpty(goodTypeMessage)){
|
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(goodTypeMessage)) {
|
|
|
lambdaQueryWrapper.in(PriceBank::getGoodTypeId, goodTypeMessage);
|
|
lambdaQueryWrapper.in(PriceBank::getGoodTypeId, goodTypeMessage);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getIsDeleted,0);
|
|
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getStatus,0);
|
|
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getIsDeleted, 0);
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getStatus, 0);
|
|
|
lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
|
|
lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getTradeType,"CK");
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()),PriceBank::getCname,priceBank.getCname());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()),PriceBank::getCode,priceBank.getCode());
|
|
|
|
|
- lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()),PriceBank::getCorpId,priceBank.getCorpId());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()),PriceBank::getSpecs,priceBank.getSpecs());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getGoodsTypeName()),PriceBank::getGoodsTypeName,priceBank.getGoodsTypeName());
|
|
|
|
|
- lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()),PriceBank::getEndTime,priceBank.getStatusTime());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getEname()),PriceBank::getEname,priceBank.getEname());
|
|
|
|
|
- lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getDateValidityStart()),PriceBank::getEndTime,priceBank.getDateValidityStart());
|
|
|
|
|
- lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getDateValidityEnd()),PriceBank::getEndTime,priceBank.getDateValidityEnd());
|
|
|
|
|
- lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()),PriceBank::getBillType,priceBank.getBillType());
|
|
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getTradeType, "CK");
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()), PriceBank::getCname, priceBank.getCname());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()), PriceBank::getCode, priceBank.getCode());
|
|
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()), PriceBank::getCorpId, priceBank.getCorpId());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()), PriceBank::getSpecs, priceBank.getSpecs());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getGoodsTypeName()), PriceBank::getGoodsTypeName, priceBank.getGoodsTypeName());
|
|
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()), PriceBank::getEndTime, priceBank.getStatusTime());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getEname()), PriceBank::getEname, priceBank.getEname());
|
|
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getDateValidityStart()), PriceBank::getEndTime, priceBank.getDateValidityStart());
|
|
|
|
|
+ lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getDateValidityEnd()), PriceBank::getEndTime, priceBank.getDateValidityEnd());
|
|
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()), PriceBank::getBillType, priceBank.getBillType());
|
|
|
lambdaQueryWrapper.orderByDesc(PriceBank::getId);
|
|
lambdaQueryWrapper.orderByDesc(PriceBank::getId);
|
|
|
//客户
|
|
//客户
|
|
|
List<CorpsDesc> corpsDescList = new ArrayList<>();
|
|
List<CorpsDesc> corpsDescList = new ArrayList<>();
|
|
@@ -241,8 +256,8 @@ public class PriceBankController extends BladeController {
|
|
|
goodsSpecificationList = castToList(redisTemplate.opsForValue().get("specification"), GoodsSpecification.class);
|
|
goodsSpecificationList = castToList(redisTemplate.opsForValue().get("specification"), GoodsSpecification.class);
|
|
|
}
|
|
}
|
|
|
List<PriceBank> pages = priceBankService.list(lambdaQueryWrapper);
|
|
List<PriceBank> pages = priceBankService.list(lambdaQueryWrapper);
|
|
|
- if (CollectionUtils.isNotEmpty(pages)){
|
|
|
|
|
- for(PriceBank item :pages){
|
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(pages)) {
|
|
|
|
|
+ for (PriceBank item : pages) {
|
|
|
if (ObjectUtils.isNotNull(item.getItemId())) {
|
|
if (ObjectUtils.isNotNull(item.getItemId())) {
|
|
|
//商品
|
|
//商品
|
|
|
GoodsDesc goodsDesc = goodsList.stream().filter(goods -> goods.getId().equals(item.getItemId())).findFirst().orElse(null);
|
|
GoodsDesc goodsDesc = goodsList.stream().filter(goods -> goods.getId().equals(item.getItemId())).findFirst().orElse(null);
|
|
@@ -318,6 +333,7 @@ public class PriceBankController extends BladeController {
|
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
return R.status(priceBankService.removeByIds(Func.toLongList(ids)));
|
|
return R.status(priceBankService.removeByIds(Func.toLongList(ids)));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 分页 出口价格库
|
|
* 分页 出口价格库
|
|
|
*/
|
|
*/
|
|
@@ -326,32 +342,32 @@ public class PriceBankController extends BladeController {
|
|
|
@ApiOperation(value = "所有数据", notes = "传入priceBank")
|
|
@ApiOperation(value = "所有数据", notes = "传入priceBank")
|
|
|
public R<List> messageList(PriceBankVO priceBank, Query query) {
|
|
public R<List> messageList(PriceBankVO priceBank, Query query) {
|
|
|
LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getIsDeleted,0);
|
|
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getStatus,0);
|
|
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getIsDeleted, 0);
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getStatus, 0);
|
|
|
lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
|
|
lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
|
|
|
- lambdaQueryWrapper.eq(PriceBank::getTradeType,"CK");
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()),PriceBank::getCname,priceBank.getCname());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()),PriceBank::getCode,priceBank.getCode());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getEname()),PriceBank::getEname,priceBank.getEname());
|
|
|
|
|
- lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()),PriceBank::getCorpId,priceBank.getCorpId());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()),PriceBank::getSpecs,priceBank.getSpecs());
|
|
|
|
|
- lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getGoodsTypeName()),PriceBank::getGoodsTypeName,priceBank.getGoodsTypeName());
|
|
|
|
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getTradeType, "CK");
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()), PriceBank::getCname, priceBank.getCname());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()), PriceBank::getCode, priceBank.getCode());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getEname()), PriceBank::getEname, priceBank.getEname());
|
|
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()), PriceBank::getCorpId, priceBank.getCorpId());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()), PriceBank::getSpecs, priceBank.getSpecs());
|
|
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getGoodsTypeName()), PriceBank::getGoodsTypeName, priceBank.getGoodsTypeName());
|
|
|
//lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getStatusTime()),PriceBank::getStartTime,priceBank.getStatusTime());
|
|
//lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getStatusTime()),PriceBank::getStartTime,priceBank.getStatusTime());
|
|
|
- lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()),PriceBank::getEndTime,priceBank.getStatusTime());
|
|
|
|
|
- lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getDateValidityStart()),PriceBank::getEndTime,priceBank.getDateValidityStart());
|
|
|
|
|
- lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getDateValidityEnd()),PriceBank::getEndTime,priceBank.getDateValidityEnd());
|
|
|
|
|
- lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()),PriceBank::getBillType,priceBank.getBillType());
|
|
|
|
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()), PriceBank::getEndTime, priceBank.getStatusTime());
|
|
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getDateValidityStart()), PriceBank::getEndTime, priceBank.getDateValidityStart());
|
|
|
|
|
+ lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getDateValidityEnd()), PriceBank::getEndTime, priceBank.getDateValidityEnd());
|
|
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()), PriceBank::getBillType, priceBank.getBillType());
|
|
|
lambdaQueryWrapper.orderByDesc(PriceBank::getId);
|
|
lambdaQueryWrapper.orderByDesc(PriceBank::getId);
|
|
|
List<PriceBank> list = priceBankService.list(lambdaQueryWrapper);
|
|
List<PriceBank> list = priceBankService.list(lambdaQueryWrapper);
|
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
|
|
- list.stream().forEach(item ->{
|
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
|
|
+ list.stream().forEach(item -> {
|
|
|
R<GoodsDescVO> goodsDesc = goodsDescClient.selectGoodsMessage(item.getItemId());
|
|
R<GoodsDescVO> goodsDesc = goodsDescClient.selectGoodsMessage(item.getItemId());
|
|
|
- if (goodsDesc != null && goodsDesc.getData() != null){
|
|
|
|
|
|
|
+ if (goodsDesc != null && goodsDesc.getData() != null) {
|
|
|
item.setCnameDescription(goodsDesc.getData().getCnameDescription());
|
|
item.setCnameDescription(goodsDesc.getData().getCnameDescription());
|
|
|
}
|
|
}
|
|
|
if (item.getCorpId() != null) {
|
|
if (item.getCorpId() != null) {
|
|
|
R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(item.getCorpId());
|
|
R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(item.getCorpId());
|
|
|
- if (corpMessage.isSuccess() && corpMessage.getData() != null){
|
|
|
|
|
|
|
+ if (corpMessage.isSuccess() && corpMessage.getData() != null) {
|
|
|
item.setCorpCode(corpMessage.getData().getCode());
|
|
item.setCorpCode(corpMessage.getData().getCode());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -360,6 +376,7 @@ public class PriceBankController extends BladeController {
|
|
|
}
|
|
}
|
|
|
return R.data(priceBankService.list(lambdaQueryWrapper));
|
|
return R.data(priceBankService.list(lambdaQueryWrapper));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 导出模板
|
|
* 导出模板
|
|
|
*/
|
|
*/
|
|
@@ -370,6 +387,7 @@ public class PriceBankController extends BladeController {
|
|
|
List<PriceBankExcel> list = new ArrayList<>();
|
|
List<PriceBankExcel> list = new ArrayList<>();
|
|
|
ExcelUtil.export(response, "价格库", "价格管理数据表", list, PriceBankExcel.class);
|
|
ExcelUtil.export(response, "价格库", "价格管理数据表", list, PriceBankExcel.class);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 导入价格
|
|
* 导入价格
|
|
|
*/
|
|
*/
|
|
@@ -378,10 +396,10 @@ public class PriceBankController extends BladeController {
|
|
|
@ApiOperation(value = "导入价格", notes = "传入excel")
|
|
@ApiOperation(value = "导入价格", notes = "传入excel")
|
|
|
public R importUser(MultipartFile file) {
|
|
public R importUser(MultipartFile file) {
|
|
|
List<PriceBankExcel> excelList = ExcelUtil.read(file, PriceBankExcel.class);
|
|
List<PriceBankExcel> excelList = ExcelUtil.read(file, PriceBankExcel.class);
|
|
|
- if (CollectionUtils.isEmpty(excelList)){
|
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(excelList)) {
|
|
|
throw new SecurityException("数据不能为空");
|
|
throw new SecurityException("数据不能为空");
|
|
|
}
|
|
}
|
|
|
- return priceBankService.importUser(excelList,false);
|
|
|
|
|
|
|
+ return priceBankService.importUser(excelList, false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|