Browse Source

Merge remote-tracking branch 'origin/master'

v1
前端-胡立永 4 weeks ago
parent
commit
36febe827d
5 changed files with 105 additions and 45 deletions
  1. BIN
      admin-pc/dist.zip
  2. +11
    -12
      admin-pc/src/views/city/CommonCityList.vue
  3. +11
    -12
      admin-pc/src/views/commonVip/CommonVipList.vue
  4. +41
    -6
      module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderServiceImpl.java
  5. +42
    -15
      module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderTeamServiceImpl.java

BIN
admin-pc/dist.zip View File


+ 11
- 12
admin-pc/src/views/city/CommonCityList.vue View File

@ -12,18 +12,17 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('开通包邮城市')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('开通包邮城市')">导出</a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
<!-- </a-menu>-->
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
<!-- </a-dropdown>-->
</div>
<!-- table区域-begin -->


+ 11
- 12
admin-pc/src/views/commonVip/CommonVipList.vue View File

@ -12,18 +12,17 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('品牌管理')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
<!-- <a-button type="primary" icon="download" @click="handleExportXls('品牌管理')">导出</a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
<!-- </a-menu>-->
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
<!-- </a-dropdown>-->
</div>
<!-- table区域-begin -->


+ 41
- 6
module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderServiceImpl.java View File

@ -291,13 +291,32 @@ public class AppletOrderServiceImpl implements AppletOrderService {
titles.add(commonShop.getName());
// 计算最低价格
if (commonShop.getPrice() != null){
minEstimatedPrice = commonShop.getPrice().multiply(new BigDecimal(sku.getNum()));
minEstimatedPriceSum = minEstimatedPriceSum.add(commonShop.getPrice().multiply(new BigDecimal(sku.getNum())));
minEstimatedPriceSum = minEstimatedPriceSum.add(minEstimatedPrice);
}
// 计算最高价格
if (commonShop.getMaxPrice() != null){
maxEstimatedPrice = commonShop.getMaxPrice().multiply(new BigDecimal(sku.getNum()));
maxEstimatedPriceSum = maxEstimatedPriceSum.add(commonShop.getMaxPrice().multiply(new BigDecimal(sku.getNum())));
maxEstimatedPriceSum = maxEstimatedPriceSum.add(maxEstimatedPrice);
} else {
// 如果没有最高价格使用最低价格作为最高价格
maxEstimatedPrice = minEstimatedPrice;
maxEstimatedPriceSum = maxEstimatedPriceSum.add(maxEstimatedPrice);
}
// 验证价格逻辑确保最低价格不大于最高价格
if (minEstimatedPrice.compareTo(maxEstimatedPrice) > 0) {
log.warn("商品 {} 的最低价格({}) 高于最高价格({}),已自动修正",
commonShop.getName(), minEstimatedPrice, maxEstimatedPrice);
// 如果最低价格高于最高价格将最高价格设置为最低价格
maxEstimatedPrice = minEstimatedPrice;
// 重新计算总价
maxEstimatedPriceSum = maxEstimatedPriceSum.subtract(commonShop.getMaxPrice() != null ?
commonShop.getMaxPrice().multiply(new BigDecimal(sku.getNum())) : BigDecimal.ZERO)
.add(maxEstimatedPrice);
}
@ -373,7 +392,6 @@ public class AppletOrderServiceImpl implements AppletOrderService {
if (isFreeShipping){
commonOrderService.save(cityOrder);
// TODO 包邮直接进行快递上门 进行物流下单
cityOrder.setStatus(1);
cityOrder.setState(0);
@ -397,11 +415,28 @@ public class AppletOrderServiceImpl implements AppletOrderService {
//计算价格显示
private String calculatePriceDisplay(BigDecimal price, BigDecimal maxPrice){
// 如果maxPrice为空或者相等则返回price
if(maxPrice == null || maxPrice.compareTo(BigDecimal.ZERO) == 0){
// 参数验证
if (price == null || price.compareTo(BigDecimal.ZERO) < 0) {
return "0";
}
// 如果maxPrice为空或者为0则只返回最低价格
if(maxPrice == null || maxPrice.compareTo(BigDecimal.ZERO) <= 0){
return price.stripTrailingZeros().toPlainString();
}
// 如果price为空则返回price-maxPrice
// 验证价格逻辑确保最低价格不大于最高价格
if (price.compareTo(maxPrice) > 0) {
log.warn("最低价格({}) 高于最高价格({}),已自动修正为单价格显示", price, maxPrice);
return price.stripTrailingZeros().toPlainString();
}
// 如果最低价格等于最高价格只显示一个价格
if (price.compareTo(maxPrice) == 0) {
return price.stripTrailingZeros().toPlainString();
}
// 正常情况显示价格范围
return price.stripTrailingZeros().toPlainString() + " - " + maxPrice.stripTrailingZeros().toPlainString();
}


+ 42
- 15
module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderTeamServiceImpl.java View File

@ -29,6 +29,7 @@ import org.jeecg.modules.hanHaiMember.entity.HanHaiMember;
import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
@ -486,26 +487,32 @@ public class AppletOrderTeamServiceImpl implements AppletOrderTeamService {
}
@Override
@Transactional
public Result<?> submitQualityInfo2(String token, String id, String listJson) {
if (StringUtils.isBlank(token)){
Result.error("token不能为空");
return Result.error("token不能为空");
}
HanHaiMember member = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
if (member == null) {
return Result.error("用户token无效");
}
if (StringUtils.isBlank(listJson)){
Result.error("list不能为空");
return Result.error("list不能为空");
}
CommonOrder order = commonOrderService.getById(id);
if (order == null){
Result.error("订单无效");
return Result.error("订单无效");
}
List<CommonOrder> list = JSON.parseArray(listJson, CommonOrder.class);
if (list == null || list.isEmpty()) {
return Result.error("订单列表为空");
}
BigDecimal priceSum = new BigDecimal(0);//总价格
Integer qualifiedNumSum = 0;//合格数量
@ -513,11 +520,23 @@ public class AppletOrderTeamServiceImpl implements AppletOrderTeamService {
Integer unrecyclableSum = 0;//不可回收数量
for (CommonOrder orderReq : list) {
if (orderReq == null) {
continue; // 跳过null的订单项
}
priceSum = priceSum.add(orderReq.getPrice());
qualifiedNumSum += orderReq.getQualifiedNum();
noQualifiedNumSum += orderReq.getNoQualifiedNum();
unrecyclableSum += orderReq.getUnrecyclable();
// 安全地处理可能为null的数值
if (orderReq.getPrice() != null) {
priceSum = priceSum.add(orderReq.getPrice());
}
if (orderReq.getQualifiedNum() != null) {
qualifiedNumSum += orderReq.getQualifiedNum();
}
if (orderReq.getNoQualifiedNum() != null) {
noQualifiedNumSum += orderReq.getNoQualifiedNum();
}
if (orderReq.getUnrecyclable() != null) {
unrecyclableSum += orderReq.getUnrecyclable();
}
//设置用户
orderReq.setUserId(member.getId());
@ -525,16 +544,24 @@ public class AppletOrderTeamServiceImpl implements AppletOrderTeamService {
orderReq.setHasChild("1");
orderReq.setType(1);
//设置商品
if (StringUtils.isNotBlank(orderReq.getShopId())){
CommonShop shop = commonShopService.getById(orderReq.getShopId());
orderReq.setUnit(shop.getUnit());
orderReq.setImage(shop.getImage());
orderReq.setTitle(shop.getName());
orderReq.setDetails(shop.getService());
orderReq.setShopClass(shop.getShopClass());
orderReq.setCreateTime(new Date());
}else if (orderReq.getTestingStatus() == 1){
if (shop != null) {
orderReq.setUnit(shop.getUnit());
orderReq.setImage(shop.getImage());
orderReq.setTitle(shop.getName());
orderReq.setDetails(shop.getService());
orderReq.setShopClass(shop.getShopClass());
orderReq.setCreateTime(new Date());
} else {
// 商品不存在时的处理
orderReq.setTitle("商品不存在");
orderReq.setCreateTime(new Date());
}
}else if (orderReq.getTestingStatus() != null && orderReq.getTestingStatus() == 1){
//质量问题
orderReq.setTitle("质量问题");
}else {


Loading…
Cancel
Save