diff --git a/config/application.yml b/config/application.yml index 4e5c9dac..ff9ed60e 100644 --- a/config/application.yml +++ b/config/application.yml @@ -24,13 +24,13 @@ spring: boot: admin: client: - url: http://192.168.0.108:8000 + url: http://127.0.0.1:8000 cache: type: redis # Redis redis: - host: 192.168.0.108 - port: 30379 + host: 127.0.0.1 + port: 6379 password: lilishop lettuce: pool: @@ -60,7 +60,7 @@ spring: default-datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.0.108:30306/kuaidi100?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai + url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai username: root password: lilishop maxActive: 50 @@ -241,16 +241,16 @@ lili: sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6 #域名 domain: - pc: http://192.168.0.108:8888 - wap: http://192.168.0.108:8888 - seller: http://192.168.0.108:8888 - admin: http://192.168.0.108:8888 + pc: http://127.0.0.1:8888 + wap: http://127.0.0.1:8888 + seller: http://127.0.0.1:8888 + admin: http://127.0.0.1:8888 #api地址 api: buyer: https://z171l91606.51mypc.cn - base: http://192.168.0.108:8888 - manager: http://192.168.0.108:8888 - seller: http://192.168.0.108:8888 + base: http://127.0.0.1:8888 + manager: http://127.0.0.1:8888 + seller: http://127.0.0.1:8888 # jwt 细节设定 jwt-setting: @@ -269,7 +269,7 @@ lili: data: elasticsearch: cluster-name: elasticsearch - cluster-nodes: 192.168.0.108:30920 + cluster-nodes: 127.0.0.1:9200 index: number-of-replicas: 0 number-of-shards: 3 @@ -301,7 +301,7 @@ lili: after-sale-topic: lili_after_sale_topic after-sale-group: lili_after_sale_group rocketmq: - name-server: 192.168.0.108:30876 + name-server: 127.0.0.1:9876 isVIPChannel: false producer: group: lili_group @@ -310,7 +310,7 @@ rocketmq: xxl: job: admin: - addresses: http://192.168.0.108:9001/xxl-job-admin + addresses: http://127.0.0.1:9001/xxl-job-admin executor: appname: xxl-job-executor-lilishop address: diff --git a/consumer/src/main/java/cn/lili/event/impl/GoodsSkuExecute.java b/consumer/src/main/java/cn/lili/event/impl/GoodsSkuExecute.java index 6d91e9e7..47b77d6f 100644 --- a/consumer/src/main/java/cn/lili/event/impl/GoodsSkuExecute.java +++ b/consumer/src/main/java/cn/lili/event/impl/GoodsSkuExecute.java @@ -1,12 +1,21 @@ package cn.lili.event.impl; +import cn.lili.cache.Cache; +import cn.lili.cache.CachePrefix; import cn.lili.event.GoodsCommentCompleteEvent; +import cn.lili.event.StoreSettingChangeEvent; +import cn.lili.modules.goods.entity.dos.GoodsSku; +import cn.lili.modules.goods.entity.dto.GoodsSearchParams; import cn.lili.modules.goods.service.GoodsSkuService; import cn.lili.modules.member.entity.dos.MemberEvaluation; +import cn.lili.modules.store.entity.dos.Store; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + /** * 商品SKU变化 * @@ -14,7 +23,7 @@ import org.springframework.stereotype.Service; * @since 2020-07-03 11:20 */ @Service -public class GoodsSkuExecute implements GoodsCommentCompleteEvent { +public class GoodsSkuExecute implements GoodsCommentCompleteEvent, StoreSettingChangeEvent { /** * 商品 @@ -22,9 +31,23 @@ public class GoodsSkuExecute implements GoodsCommentCompleteEvent { @Autowired private GoodsSkuService goodsSkuService; + @Autowired + private Cache cache; @Override public void goodsComment(MemberEvaluation memberEvaluation) { goodsSkuService.updateGoodsSkuCommentNum(memberEvaluation.getSkuId()); } + + @Override + public void storeSettingChange(Store store) { + //修改数据后,清除商品索引 + GoodsSearchParams goodsSearchParams = new GoodsSearchParams(); + goodsSearchParams.setStoreId(store.getId()); + List goodsSkuKeys = new ArrayList<>(); + for (GoodsSku goodsSku : goodsSkuService.getGoodsSkuByList(goodsSearchParams)) { + goodsSkuKeys.add(CachePrefix.GOODS_SKU.getPrefix()+goodsSku.getId()); + } + cache.multiDel(goodsSkuKeys); + } } diff --git a/framework/src/main/java/cn/lili/common/enums/ResultCode.java b/framework/src/main/java/cn/lili/common/enums/ResultCode.java index d04690f5..e2b702d2 100644 --- a/framework/src/main/java/cn/lili/common/enums/ResultCode.java +++ b/framework/src/main/java/cn/lili/common/enums/ResultCode.java @@ -202,8 +202,8 @@ public enum ResultCode { ORDER_BATCH_DELIVER_ERROR(31013, "批量发货,文件读取失败"), ORDER_ITEM_NOT_EXIST(31014, "当前订单项不存在!"), POINT_NOT_ENOUGH(31015, "当前会员积分不足购买当前积分商品!"), - ORDER_LABEL_ORDER_ERROR(31016, "订单不能打印电子面单"), + ORDER_PRICE_ERROR(31017,"订单金额不能小于等于0"), /** diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java index 6b0cb37a..669e6241 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsSearchServiceImpl.java @@ -98,7 +98,7 @@ public class EsGoodsSearchServiceImpl implements EsGoodsSearchService { @Override public EsGoodsRelatedInfo getSelector(EsGoodsSearchDTO goodsSearch, PageVO pageVo) { - NativeSearchQueryBuilder builder = createSearchQueryBuilder(goodsSearch, null); + NativeSearchQueryBuilder builder = createSearchQueryBuilder(goodsSearch, pageVo); //分类 AggregationBuilder categoryNameBuilder = AggregationBuilders.terms("categoryNameAgg").field("categoryNamePath.keyword"); builder.addAggregation(AggregationBuilders.terms("categoryAgg").field("categoryPath").subAggregation(categoryNameBuilder)); diff --git a/framework/src/main/java/cn/lili/modules/store/entity/dos/Store.java b/framework/src/main/java/cn/lili/modules/store/entity/dos/Store.java index 0c478eca..ba05c5dc 100644 --- a/framework/src/main/java/cn/lili/modules/store/entity/dos/Store.java +++ b/framework/src/main/java/cn/lili/modules/store/entity/dos/Store.java @@ -82,7 +82,7 @@ public class Store extends BaseEntity { @ApiModelProperty(value = "服务评分") private Double serviceScore; - @ApiModelProperty(value = "物流描述") + @ApiModelProperty(value = "物流评分") private Double deliveryScore; @ApiModelProperty(value = "商品数量") diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java index 5490043d..a45ef8a6 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreServiceImpl.java @@ -189,7 +189,7 @@ public class StoreServiceImpl extends ServiceImpl implements } /** - * 修改店铺详细细腻 + * 修改店铺详细信息 * * @param storeEditDTO 修改店铺信息 */ @@ -304,7 +304,7 @@ public class StoreServiceImpl extends ServiceImpl implements //获取当前操作的店铺 Store store = getStoreByMember(); - //校验迪纳普状态 + //校验店铺状态 checkStoreStatus(store); StoreDetail storeDetail = storeDetailService.getStoreDetail(store.getId()); //设置店铺的银行信息 @@ -317,7 +317,7 @@ public class StoreServiceImpl extends ServiceImpl implements //获取当前操作的店铺 Store store = getStoreByMember(); - //校验迪纳普状态 + //校验店铺状态 checkStoreStatus(store); BeanUtil.copyProperties(storeOtherInfoDTO, store); diff --git a/manager-api/src/main/java/cn/lili/controller/order/OrderManagerController.java b/manager-api/src/main/java/cn/lili/controller/order/OrderManagerController.java index 00fc6bf8..07ef50e2 100644 --- a/manager-api/src/main/java/cn/lili/controller/order/OrderManagerController.java +++ b/manager-api/src/main/java/cn/lili/controller/order/OrderManagerController.java @@ -1,6 +1,9 @@ package cn.lili.controller.order; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.NumberUtil; import cn.lili.common.aop.annotation.PreventDuplicateSubmissions; +import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.ResultUtil; import cn.lili.common.vo.ResultMessage; import cn.lili.modules.member.entity.dto.MemberAddressDTO; @@ -96,7 +99,11 @@ public class OrderManagerController { @PutMapping(value = "/update/{orderSn}/price") public ResultMessage updateOrderPrice(@PathVariable String orderSn, @NotNull(message = "订单价格不能为空") @RequestParam Double price) { - return ResultUtil.data(orderPriceService.updatePrice(orderSn, price)); + if (NumberUtil.isGreater(Convert.toBigDecimal(price), Convert.toBigDecimal(0))) { + return ResultUtil.data(orderPriceService.updatePrice(orderSn, price)); + } else { + return ResultUtil.error(ResultCode.ORDER_PRICE_ERROR); + } } diff --git a/seller-api/src/main/java/cn/lili/controller/order/OrderStoreController.java b/seller-api/src/main/java/cn/lili/controller/order/OrderStoreController.java index d1345a1b..af8893f8 100644 --- a/seller-api/src/main/java/cn/lili/controller/order/OrderStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/order/OrderStoreController.java @@ -1,5 +1,7 @@ package cn.lili.controller.order; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.NumberUtil; import cn.lili.common.aop.annotation.PreventDuplicateSubmissions; import cn.lili.common.context.ThreadContextHolder; import cn.lili.common.enums.ResultCode; @@ -103,7 +105,11 @@ public class OrderStoreController { @PutMapping(value = "/update/{orderSn}/price") public ResultMessage updateOrderPrice(@PathVariable String orderSn, @NotNull(message = "订单价格不能为空") @RequestParam Double orderPrice) { - return ResultUtil.data(orderPriceService.updatePrice(orderSn, orderPrice)); + if (NumberUtil.isGreater(Convert.toBigDecimal(orderPrice), Convert.toBigDecimal(0))) { + return ResultUtil.data(orderPriceService.updatePrice(orderSn, orderPrice)); + } else { + return ResultUtil.error(ResultCode.ORDER_PRICE_ERROR); + } } @PreventDuplicateSubmissions diff --git a/seller-api/src/main/java/cn/lili/controller/other/LogisticsStoreController.java b/seller-api/src/main/java/cn/lili/controller/other/LogisticsStoreController.java index 40c0f783..3219474f 100644 --- a/seller-api/src/main/java/cn/lili/controller/other/LogisticsStoreController.java +++ b/seller-api/src/main/java/cn/lili/controller/other/LogisticsStoreController.java @@ -82,7 +82,7 @@ public class LogisticsStoreController { @DeleteMapping(value = "/{id}") public ResultMessage cancel(@PathVariable String id) { String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); - boolean remove = storeLogisticsService.remove(new LambdaQueryWrapper().eq(StoreLogistics::getId, id).eq(StoreLogistics::getStoreId, storeId)); + boolean remove = storeLogisticsService.remove(new LambdaQueryWrapper().eq(StoreLogistics::getLogisticsId, id).eq(StoreLogistics::getStoreId, storeId)); return ResultUtil.data(remove); }