Commit 6ecc3b1e authored by 332784038@qq.com's avatar 332784038@qq.com

阶梯价格导出bug修复,区分费用模式来分开处理导出数据

parent 307f3775
......@@ -193,157 +193,158 @@ public class ProductPriceExcelExportListener {
StringBuilder ytqgfSb = new StringBuilder();
StringBuilder ddyfSb = new StringBuilder();
StringBuilder ddqgfSb = new StringBuilder();
if (CollectionUtil.isNotEmpty(yfStepList)) {
yfStepList.sort(Comparator.comparing(ProductPriceStepDO::getRankNum));
for (int j = 1; j <= yfStepList.size(); j++) {
ProductPriceStepDO stepDO = yfStepList.get(j - 1);
List<ProductPriceStepSpecialDO> stepSpecialDOS = stepDO.getSpecialList();
if (CollectionUtil.isNotEmpty(stepSpecialDOS)) {
Map<String, ProductPriceStepSpecialDO> stepSpecialDOMap = stepSpecialDOS.stream()
.collect(Collectors.toMap(ProductPriceStepSpecialDO::getSpecialDictType, v -> v, (v1, v2) -> v2));
//有牌
ProductPriceStepSpecialDO yp = stepSpecialDOMap.get("licensed_price");
//中性
ProductPriceStepSpecialDO zx = stepSpecialDOMap.get("neutral_brand_prices");
//液体
ProductPriceStepSpecialDO yt = stepSpecialDOMap.get("liquid_price");
//带电
ProductPriceStepSpecialDO dd = stepSpecialDOMap.get("live_price");
String stepInfo = "第" + j + "阶梯: ";
addStepSpecialPrice(yp, currencyMap, unitMap, ypyfSb, stepInfo, PriceTypeEnum.FREIGHT);
addStepSpecialPrice(zx, currencyMap, unitMap, zxyfSb, stepInfo, PriceTypeEnum.FREIGHT);
addStepSpecialPrice(yt, currencyMap, unitMap, ytyfSb, stepInfo, PriceTypeEnum.FREIGHT);
addStepSpecialPrice(dd, currencyMap, unitMap, ddyfSb, stepInfo, PriceTypeEnum.FREIGHT);
if (i != yfStepList.size()) {
ypyfSb.append((char) 10);
zxyfSb.append((char) 10);
ytyfSb.append((char) 10);
ddyfSb.append((char) 10);
if (item.getPriceType() == 0) {
if (CollectionUtil.isNotEmpty(yfStepList)) {
yfStepList.sort(Comparator.comparing(ProductPriceStepDO::getRankNum));
for (int j = 1; j <= yfStepList.size(); j++) {
ProductPriceStepDO stepDO = yfStepList.get(j - 1);
List<ProductPriceStepSpecialDO> stepSpecialDOS = stepDO.getSpecialList();
if (CollectionUtil.isNotEmpty(stepSpecialDOS)) {
Map<String, ProductPriceStepSpecialDO> stepSpecialDOMap = stepSpecialDOS.stream()
.collect(Collectors.toMap(ProductPriceStepSpecialDO::getSpecialDictType, v -> v, (v1, v2) -> v2));
//有牌
ProductPriceStepSpecialDO yp = stepSpecialDOMap.get("licensed_price");
//中性
ProductPriceStepSpecialDO zx = stepSpecialDOMap.get("neutral_brand_prices");
//液体
ProductPriceStepSpecialDO yt = stepSpecialDOMap.get("liquid_price");
//带电
ProductPriceStepSpecialDO dd = stepSpecialDOMap.get("live_price");
String stepInfo = "第" + j + "阶梯: ";
addStepSpecialPrice(yp, currencyMap, unitMap, ypyfSb, stepInfo, PriceTypeEnum.FREIGHT);
addStepSpecialPrice(zx, currencyMap, unitMap, zxyfSb, stepInfo, PriceTypeEnum.FREIGHT);
addStepSpecialPrice(yt, currencyMap, unitMap, ytyfSb, stepInfo, PriceTypeEnum.FREIGHT);
addStepSpecialPrice(dd, currencyMap, unitMap, ddyfSb, stepInfo, PriceTypeEnum.FREIGHT);
if (i != yfStepList.size()) {
ypyfSb.append((char) 10);
zxyfSb.append((char) 10);
ytyfSb.append((char) 10);
ddyfSb.append((char) 10);
}
}
}
String stepTransportPrice = getPrice(stepDO.getTransportPrice(),
stepDO.getTransportPriceUnit().intValue(),
stepDO.getTransportVolumeUnit().intValue(), currencyMap, unitMap);
String stepTransportPrice = getPrice(stepDO.getTransportPrice(),
stepDO.getTransportPriceUnit().intValue(),
stepDO.getTransportVolumeUnit().intValue(), currencyMap, unitMap);
Long weightUnit = stepDO.getWeightUnit();
String unit = "";
if (weightUnit != null) {
UnitDO unitDO = unitMap.get(weightUnit.intValue());
unit = Objects.nonNull(unitDO)?unitDO.getTitleZh():"空";
}
BigDecimal startNum = stepDO.getStartNum();
BigDecimal endNum = stepDO.getEndNum();
transportPriceSb.append("第").append(j).append("阶梯:").append(startNum)
.append("-").append(endNum).append(unit).append(" ").append(stepTransportPrice);
if (i != stepList.size()) {
transportPriceSb.append((char) 10);
Long weightUnit = stepDO.getWeightUnit();
String unit = "";
if (weightUnit != null) {
UnitDO unitDO = unitMap.get(weightUnit.intValue());
unit = Objects.nonNull(unitDO) ? unitDO.getTitleZh() : "空";
}
BigDecimal startNum = stepDO.getStartNum();
BigDecimal endNum = stepDO.getEndNum();
transportPriceSb.append("第").append(j).append("阶梯:").append(startNum)
.append("-").append(endNum).append(unit).append(" ").append(stepTransportPrice);
if (i != stepList.size()) {
transportPriceSb.append((char) 10);
}
}
}
}
if (CollectionUtil.isNotEmpty(qgfStepList)) {
qgfStepList.sort(Comparator.comparing(ProductPriceStepDO::getRankNum));
for (int j = 1; j <= qgfStepList.size(); j++) {
ProductPriceStepDO stepDO = qgfStepList.get(j - 1);
List<ProductPriceStepSpecialDO> stepSpecialDOS = stepDO.getSpecialList();
if (CollectionUtil.isNotEmpty(stepSpecialDOS)) {
Map<String, ProductPriceStepSpecialDO> stepSpecialDOMap = stepSpecialDOS.stream()
.collect(Collectors.toMap(ProductPriceStepSpecialDO::getSpecialDictType, v -> v, (v1, v2) -> v2));
//有牌
ProductPriceStepSpecialDO yp = stepSpecialDOMap.get("licensed_price");
//中性
ProductPriceStepSpecialDO zx = stepSpecialDOMap.get("neutral_brand_prices");
//液体
ProductPriceStepSpecialDO yt = stepSpecialDOMap.get("liquid_price");
//带电
ProductPriceStepSpecialDO dd = stepSpecialDOMap.get("live_price");
String stepInfo = "第" + j + "阶梯: ";
addStepSpecialPrice(yp, currencyMap, unitMap, ypqgfSb, stepInfo, PriceTypeEnum.CLEARANCE);
addStepSpecialPrice(zx, currencyMap, unitMap, zxqgfSb, stepInfo, PriceTypeEnum.CLEARANCE);
addStepSpecialPrice(yt, currencyMap, unitMap, ytqgfSb, stepInfo, PriceTypeEnum.CLEARANCE);
addStepSpecialPrice(dd, currencyMap, unitMap, ddqgfSb, stepInfo, PriceTypeEnum.CLEARANCE);
if (i != qgfStepList.size()) {
ypqgfSb.append((char) 10);
zxqgfSb.append((char) 10);
ytqgfSb.append((char) 10);
ddqgfSb.append((char) 10);
if (CollectionUtil.isNotEmpty(qgfStepList)) {
qgfStepList.sort(Comparator.comparing(ProductPriceStepDO::getRankNum));
for (int j = 1; j <= qgfStepList.size(); j++) {
ProductPriceStepDO stepDO = qgfStepList.get(j - 1);
List<ProductPriceStepSpecialDO> stepSpecialDOS = stepDO.getSpecialList();
if (CollectionUtil.isNotEmpty(stepSpecialDOS)) {
Map<String, ProductPriceStepSpecialDO> stepSpecialDOMap = stepSpecialDOS.stream()
.collect(Collectors.toMap(ProductPriceStepSpecialDO::getSpecialDictType, v -> v, (v1, v2) -> v2));
//有牌
ProductPriceStepSpecialDO yp = stepSpecialDOMap.get("licensed_price");
//中性
ProductPriceStepSpecialDO zx = stepSpecialDOMap.get("neutral_brand_prices");
//液体
ProductPriceStepSpecialDO yt = stepSpecialDOMap.get("liquid_price");
//带电
ProductPriceStepSpecialDO dd = stepSpecialDOMap.get("live_price");
String stepInfo = "第" + j + "阶梯: ";
addStepSpecialPrice(yp, currencyMap, unitMap, ypqgfSb, stepInfo, PriceTypeEnum.CLEARANCE);
addStepSpecialPrice(zx, currencyMap, unitMap, zxqgfSb, stepInfo, PriceTypeEnum.CLEARANCE);
addStepSpecialPrice(yt, currencyMap, unitMap, ytqgfSb, stepInfo, PriceTypeEnum.CLEARANCE);
addStepSpecialPrice(dd, currencyMap, unitMap, ddqgfSb, stepInfo, PriceTypeEnum.CLEARANCE);
if (i != qgfStepList.size()) {
ypqgfSb.append((char) 10);
zxqgfSb.append((char) 10);
ytqgfSb.append((char) 10);
ddqgfSb.append((char) 10);
}
}
}
String stepClearancePrice = getPrice(stepDO.getClearancePrice(),
stepDO.getClearancePriceUnit().intValue(),
stepDO.getClearanceVolumeUnit().intValue(), currencyMap, unitMap);
String stepClearancePrice = getPrice(stepDO.getClearancePrice(),
stepDO.getClearancePriceUnit().intValue(),
stepDO.getClearanceVolumeUnit().intValue(), currencyMap, unitMap);
//
Long weightUnit = stepDO.getWeightUnit();
String unit = "";
if (weightUnit != null) {
UnitDO unitDO = unitMap.get(weightUnit.intValue());
unit = unitDO.getTitleZh();
}
BigDecimal startNum = stepDO.getStartNum();
BigDecimal endNum = stepDO.getEndNum();
clearancePriceSb.append("第").append(j).append("阶梯:").append(startNum)
.append("-").append(endNum).append(unit).append(" ").append(stepClearancePrice);
if (i != stepList.size()) {
clearancePriceSb.append((char) 10);
Long weightUnit = stepDO.getWeightUnit();
String unit = "";
if (weightUnit != null) {
UnitDO unitDO = unitMap.get(weightUnit.intValue());
unit = unitDO.getTitleZh();
}
BigDecimal startNum = stepDO.getStartNum();
BigDecimal endNum = stepDO.getEndNum();
clearancePriceSb.append("第").append(j).append("阶梯:").append(startNum)
.append("-").append(endNum).append(unit).append(" ").append(stepClearancePrice);
if (i != stepList.size()) {
clearancePriceSb.append((char) 10);
}
}
}
}
if (CollectionUtil.isNotEmpty(qbjStepList) && item.getPriceType() == 1) {
qbjStepList.sort(Comparator.comparing(ProductPriceStepDO::getRankNum));
for (int j = 1; j <= qbjStepList.size(); j++) {
ProductPriceStepDO stepDO = qbjStepList.get(j - 1);
List<ProductPriceStepSpecialDO> stepSpecialDOS = stepDO.getSpecialList();
if (CollectionUtil.isNotEmpty(stepSpecialDOS)) {
Map<String, ProductPriceStepSpecialDO> stepSpecialDOMap = stepSpecialDOS.stream()
.collect(Collectors.toMap(ProductPriceStepSpecialDO::getSpecialDictType, v -> v, (v1, v2) -> v2));
//有牌
ProductPriceStepSpecialDO yp = stepSpecialDOMap.get("licensed_price");
//中性
ProductPriceStepSpecialDO zx = stepSpecialDOMap.get("neutral_brand_prices");
//液体
ProductPriceStepSpecialDO yt = stepSpecialDOMap.get("liquid_price");
//带电
ProductPriceStepSpecialDO dd = stepSpecialDOMap.get("live_price");
String stepInfo = "第" + j + "阶梯: ";
addStepSpecialPrice(yp, currencyMap, unitMap, ypyfSb, stepInfo, PriceTypeEnum.FULL_PRICE);
addStepSpecialPrice(zx, currencyMap, unitMap, zxyfSb, stepInfo, PriceTypeEnum.FULL_PRICE);
addStepSpecialPrice(yt, currencyMap, unitMap, ytyfSb, stepInfo, PriceTypeEnum.FULL_PRICE);
addStepSpecialPrice(dd, currencyMap, unitMap, ddyfSb, stepInfo, PriceTypeEnum.FULL_PRICE);
if (i != qbjStepList.size()) {
ypyfSb.append((char) 10);
zxyfSb.append((char) 10);
ytyfSb.append((char) 10);
ddyfSb.append((char) 10);
if (item.getPriceType() == 1) {
if (CollectionUtil.isNotEmpty(qbjStepList) && item.getPriceType() == 1) {
qbjStepList.sort(Comparator.comparing(ProductPriceStepDO::getRankNum));
for (int j = 1; j <= qbjStepList.size(); j++) {
ProductPriceStepDO stepDO = qbjStepList.get(j - 1);
List<ProductPriceStepSpecialDO> stepSpecialDOS = stepDO.getSpecialList();
if (CollectionUtil.isNotEmpty(stepSpecialDOS)) {
Map<String, ProductPriceStepSpecialDO> stepSpecialDOMap = stepSpecialDOS.stream()
.collect(Collectors.toMap(ProductPriceStepSpecialDO::getSpecialDictType, v -> v, (v1, v2) -> v2));
//有牌
ProductPriceStepSpecialDO yp = stepSpecialDOMap.get("licensed_price");
//中性
ProductPriceStepSpecialDO zx = stepSpecialDOMap.get("neutral_brand_prices");
//液体
ProductPriceStepSpecialDO yt = stepSpecialDOMap.get("liquid_price");
//带电
ProductPriceStepSpecialDO dd = stepSpecialDOMap.get("live_price");
String stepInfo = "第" + j + "阶梯: ";
addStepSpecialPrice(yp, currencyMap, unitMap, ypyfSb, stepInfo, PriceTypeEnum.FULL_PRICE);
addStepSpecialPrice(zx, currencyMap, unitMap, zxyfSb, stepInfo, PriceTypeEnum.FULL_PRICE);
addStepSpecialPrice(yt, currencyMap, unitMap, ytyfSb, stepInfo, PriceTypeEnum.FULL_PRICE);
addStepSpecialPrice(dd, currencyMap, unitMap, ddyfSb, stepInfo, PriceTypeEnum.FULL_PRICE);
if (i != qbjStepList.size()) {
ypyfSb.append((char) 10);
zxyfSb.append((char) 10);
ytyfSb.append((char) 10);
ddyfSb.append((char) 10);
}
}
}
//
String stepTransportPrice = getPrice(stepDO.getAllPrice(), stepDO.getAllPriceUnit().intValue(),
stepDO.getAllVolumeUnit().intValue(), currencyMap, unitMap);
String stepTransportPrice = getPrice(stepDO.getAllPrice(), stepDO.getAllPriceUnit().intValue(),
stepDO.getAllVolumeUnit().intValue(), currencyMap, unitMap);
//
Long weightUnit = stepDO.getWeightUnit();
String unit = "";
if (weightUnit != null) {
UnitDO unitDO = unitMap.get(weightUnit.intValue());
unit = Objects.nonNull(unitDO) ? unitDO.getTitleZh() : "空";
}
BigDecimal startNum = stepDO.getStartNum();
BigDecimal endNum = stepDO.getEndNum();
transportPriceSb.append("第").append(j).append("阶梯:").append(startNum)
.append("-").append(endNum).append(unit).append(" ").append(stepTransportPrice);
if (i != stepList.size()) {
transportPriceSb.append((char) 10);
Long weightUnit = stepDO.getWeightUnit();
String unit = "";
if (weightUnit != null) {
UnitDO unitDO = unitMap.get(weightUnit.intValue());
unit = Objects.nonNull(unitDO) ? unitDO.getTitleZh() : "空";
}
BigDecimal startNum = stepDO.getStartNum();
BigDecimal endNum = stepDO.getEndNum();
transportPriceSb.append("第").append(j).append("阶梯:").append(startNum)
.append("-").append(endNum).append(unit).append(" ").append(stepTransportPrice);
if (i != stepList.size()) {
transportPriceSb.append((char) 10);
}
}
}
}
transportPrice = transportPriceSb.toString();
clearancePrice = clearancePriceSb.toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment