Merge branch 'refs/heads/gyj' into test
# Conflicts: # src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUser.java
This commit is contained in:
@@ -348,4 +348,4 @@ public class TbShopUser implements Serializable {
|
|||||||
public void setAddress(String address) {
|
public void setAddress(String address) {
|
||||||
this.address = address;
|
this.address = address;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -374,6 +374,7 @@ public class ProductService {
|
|||||||
// HashSet<String> specSet = new HashSet<>();
|
// HashSet<String> specSet = new HashSet<>();
|
||||||
AtomicDouble sum = new AtomicDouble(0.0);
|
AtomicDouble sum = new AtomicDouble(0.0);
|
||||||
BigDecimal lowerPrice = null;
|
BigDecimal lowerPrice = null;
|
||||||
|
BigDecimal lowMemberPrice = null;
|
||||||
for (TbProductSku item : tbProductSkus) {
|
for (TbProductSku item : tbProductSkus) {
|
||||||
if (item.getRealSalesNumber() != null) {
|
if (item.getRealSalesNumber() != null) {
|
||||||
sum.addAndGet(item.getRealSalesNumber());
|
sum.addAndGet(item.getRealSalesNumber());
|
||||||
@@ -381,45 +382,24 @@ public class ProductService {
|
|||||||
if (lowerPrice == null || lowerPrice.compareTo(item.getSalePrice()) > 0) {
|
if (lowerPrice == null || lowerPrice.compareTo(item.getSalePrice()) > 0) {
|
||||||
lowerPrice = item.getSalePrice();
|
lowerPrice = item.getSalePrice();
|
||||||
}
|
}
|
||||||
|
if (lowMemberPrice == null || lowMemberPrice.compareTo(item.getMemberPrice()) > 0) {
|
||||||
String specSnap = item.getSpecSnap();
|
lowMemberPrice = item.getMemberPrice();
|
||||||
// if (specSnap != null) {
|
}
|
||||||
// specSet.addAll(Arrays.asList(specSnap.split(",")));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
//销量
|
// 销量
|
||||||
it.setStockNumber(sum.intValue());
|
it.setStockNumber(sum.intValue());
|
||||||
|
|
||||||
|
// 售价
|
||||||
if (lowerPrice == null) {
|
if (lowerPrice == null) {
|
||||||
lowerPrice = BigDecimal.ZERO;
|
lowerPrice = BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
//售价
|
|
||||||
it.setLowPrice(lowerPrice);
|
it.setLowPrice(lowerPrice);
|
||||||
// String tagSnap = skuResult != null ? skuResult.getTagSnap() : null;
|
|
||||||
// if (tagSnap != null) {
|
// 会员价
|
||||||
// JSONArray tagSnaps = JSONObject.parseArray(tagSnap);
|
if (lowMemberPrice == null) {
|
||||||
// JSONObject snapJSON;
|
lowMemberPrice = BigDecimal.ZERO;
|
||||||
// JSONArray finalSnap = new JSONArray();
|
}
|
||||||
// for (Object snap : tagSnaps) {
|
it.setLowMemberPrice(lowMemberPrice);
|
||||||
// snapJSON = (JSONObject) snap;
|
|
||||||
// String values = snapJSON.getString("value");
|
|
||||||
// String finalValues = "";
|
|
||||||
// if (StrUtil.isNotBlank(values)) {
|
|
||||||
// String[] valueList = values.split(",");
|
|
||||||
// for (String value : valueList) {
|
|
||||||
// if (specSet.contains(value)) {
|
|
||||||
// finalValues = finalValues + (value) + ",";
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (StrUtil.isNotBlank(finalValues)) {
|
|
||||||
// finalValues = StrUtil.removeSuffix(finalValues, ",");
|
|
||||||
// snapJSON.put("value", finalValues);
|
|
||||||
// finalSnap.add(snapJSON);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// //sku Result
|
|
||||||
// skuResult.setTagSnap(finalSnap.toJSONString());
|
|
||||||
// }
|
|
||||||
it.setProductSkuResult(skuResult);
|
it.setProductSkuResult(skuResult);
|
||||||
});
|
});
|
||||||
return products;
|
return products;
|
||||||
|
|||||||
Reference in New Issue
Block a user