From 8f4f27a7697d48a1dd56c9f7d19bdd4a34736d1f Mon Sep 17 00:00:00 2001 From: wangshuai Date: Wed, 17 Jul 2024 15:18:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=953?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/business/controller/BusStoreInfoController.java | 5 ++++- .../business/service/impl/BusTemplateInfoServiceImpl.java | 2 ++ .../main/resources/mapper/business/BusStoreInfoMapper.xml | 1 + ruoyi-ui/src/views/statistics/shop/index.vue | 2 -- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/business/controller/BusStoreInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/business/controller/BusStoreInfoController.java index f1f2c5f..764fd49 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/business/controller/BusStoreInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/business/controller/BusStoreInfoController.java @@ -202,11 +202,14 @@ public class BusStoreInfoController extends BaseController { if(content.contains(busTemplateAttrInfo.getAttrValue())){ content = content.replaceAll("#name",busStoreInfo.getStoreName()); content = content.replaceAll("#from",busStoreInfo.getPlatformType()); - content = content.replaceAll("#date", LocalDate.now().toString()); + content = content.replaceAll("#date", LocalDate.now().minusDays(1).toString()); content = content.replaceAll("#count",busStoreDayInfo1.getLastOrderNum()+""); content = content.replaceAll("#good",busStoreDayInfo1.getLastPositiveReviewsNum()+""); content = content.replaceAll("#five",busStoreDayInfo1.getLastFiveStarReviewsNum()+""); content = content.replaceAll("#score",busStoreDayInfo1.getScore()); + if(content.contains("#fee")&&busStoreInfo.getPrice() == null){ + throw new ServiceException("请设置单价!"); + } content = content.replaceAll("#fee",busStoreInfo.getPrice().multiply(new BigDecimal(busStoreDayInfo1.getLastFiveStarReviewsNum()))+""); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusTemplateInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusTemplateInfoServiceImpl.java index 7d3df99..e5c8557 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusTemplateInfoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/business/service/impl/BusTemplateInfoServiceImpl.java @@ -122,6 +122,8 @@ public class BusTemplateInfoServiceImpl implements IBusTemplateInfoService List list1 = busTemplateAttrInfoMapper.selectBusTemplateAttrInfoList(busTemplateAttrInfo); busTemplateInfo1.setAttrInfoList(list1); return busTemplateInfo1; + }else if(list.size() == 0){ + throw new ServiceException("请添加/编辑模版!"); } throw new ServiceException("模版信息异常!"); } diff --git a/ruoyi-system/src/main/resources/mapper/business/BusStoreInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/business/BusStoreInfoMapper.xml index 9fcdb9a..2ffbb2a 100644 --- a/ruoyi-system/src/main/resources/mapper/business/BusStoreInfoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/business/BusStoreInfoMapper.xml @@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"