From fd6df84a5380f99b08b218e305618f43f1c2fccf Mon Sep 17 00:00:00 2001 From: lqy <3431632001@qq,com> Date: Fri, 6 Dec 2024 09:54:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E8=B7=AF=E7=BA=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86--=E6=A0=B9=E6=8D=AEid=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=B7=AF=E7=BA=BF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/route/controller/RouteController.java | 9 +++++++++ .../school/route/service/impl/RouteServiceImpl.java | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/controller/RouteController.java b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/controller/RouteController.java index 7b7ac10a..6d114486 100644 --- a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/controller/RouteController.java +++ b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/controller/RouteController.java @@ -51,6 +51,15 @@ public class RouteController { routeService.deleteById(inputObject, outputObject); } + @ApiOperation(id = "queryRouteById", value = "根据id查询路线信息", method = "GET", allUse = "2") + @ApiImplicitParams({ + @ApiImplicitParam(id = "id", name = "id", value = "路线id", required = "required") + }) + @RequestMapping("/post/RouteController/queryRouteById") + public void queryRouteById(InputObject inputObject, OutputObject outputObject) { + routeService.selectById(inputObject, outputObject); + } + @ApiOperation(id = "queryRoutesByStartAndEnd", value = "根据起点id--终点id 根据路线长度升序排序", method = "GET", allUse = "2") @ApiImplicitParams({ @ApiImplicitParam(id = "startId", name = "startId", value = "起点id", required = "required"), diff --git a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/impl/RouteServiceImpl.java b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/impl/RouteServiceImpl.java index bbd2adb3..88ddeed9 100644 --- a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/impl/RouteServiceImpl.java +++ b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/impl/RouteServiceImpl.java @@ -5,6 +5,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.skyeye.annotation.service.SkyeyeService; import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl; +import com.skyeye.common.constans.CommonNumConstants; import com.skyeye.common.entity.search.CommonPageInfo; import com.skyeye.common.object.InputObject; import com.skyeye.common.object.OutputObject; @@ -57,6 +58,17 @@ public class RouteServiceImpl extends SkyeyeBusinessServiceImpl Date: Fri, 6 Dec 2024 10:11:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E8=AF=84?= =?UTF-8?q?=E4=BB=B7=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=A7=84=E6=A0=BCid=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=EF=BC=8C=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=90=8E=E4=BC=9A=E8=87=AA=E5=8A=A8=E5=88=A0=E9=99=A4=E8=B4=AD?= =?UTF-8?q?=E7=89=A9=E8=BD=A6=E4=B8=AD=E9=80=89=E4=B8=AD=E7=9A=84=E7=9A=84?= =?UTF-8?q?=E5=95=86=E5=93=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/service/impl/OrderCommentServiceImpl.java | 12 ++++++++---- .../skyeye/order/service/impl/OrderServiceImpl.java | 5 +++++ .../skyeye/store/service/ShopTradeCartService.java | 2 ++ .../store/service/impl/ShopTradeCartServiceImpl.java | 8 ++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderCommentServiceImpl.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderCommentServiceImpl.java index c121032d..0dc4e333 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderCommentServiceImpl.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderCommentServiceImpl.java @@ -188,7 +188,7 @@ public class OrderCommentServiceImpl extends SkyeyeBusinessServiceImpl getOrderCommentListByType(String typeId, Integer type) { + private List getOrderCommentListByType(String typeId, Integer type,String objectId) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq(MybatisPlusUtil.toColumns(OrderComment::getType), type) .and(wrap -> { @@ -197,6 +197,9 @@ public class OrderCommentServiceImpl extends SkyeyeBusinessServiceImpl list = list(queryWrapper); iMaterialService.setDataMation(list, OrderComment::getMaterialId); iMaterialNormsService.setDataMation(list, OrderComment::getNormsId); @@ -209,10 +212,11 @@ public class OrderCommentServiceImpl extends SkyeyeBusinessServiceImpl customerFirst = getOrderCommentListByType(typeId, OrderCommentType.CUSTOMERFiRST.getKey()); - List customerLater = getOrderCommentListByType(typeId, OrderCommentType.CUSTOMERLATER.getKey()); - List merchantReply = getOrderCommentListByType(typeId, OrderCommentType.MERCHANT.getKey()); + List customerFirst = getOrderCommentListByType(typeId, OrderCommentType.CUSTOMERFiRST.getKey(),objectId); + List customerLater = getOrderCommentListByType(typeId, OrderCommentType.CUSTOMERLATER.getKey(),objectId); + List merchantReply = getOrderCommentListByType(typeId, OrderCommentType.MERCHANT.getKey(),objectId); if (CollectionUtil.isEmpty(customerFirst)) { return; } diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java index 5f49a835..ee9e0cec 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java @@ -49,6 +49,7 @@ import com.skyeye.order.service.OrderService; import com.skyeye.rest.pay.service.IPayService; import com.skyeye.store.entity.ShopAddress; import com.skyeye.store.service.ShopAddressService; +import com.skyeye.store.service.ShopTradeCartService; import com.xxl.job.core.util.IpUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -101,6 +102,9 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl @Autowired private IQuartzService iQuartzService; + @Autowired + private ShopTradeCartService shopTradeCartService; + @Override public void createPrepose(Order order) { // 订单编号 @@ -249,6 +253,7 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl orderItemService.setValueAndCreateEntity(order, userId); couponUseService.updateState(order.getCouponUseId());// 更新用户领取的优惠券状态 startUpTaskQuartz(order.getId(), order.getOddNumber(), DateUtil.getTimeAndToString()); + shopTradeCartService.deleteMySelect(userId); } private void startUpTaskQuartz(String name, String title, String delayedTime) { diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/store/service/ShopTradeCartService.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/store/service/ShopTradeCartService.java index cf7ec565..a49d1ef0 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/store/service/ShopTradeCartService.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/store/service/ShopTradeCartService.java @@ -29,4 +29,6 @@ public interface ShopTradeCartService extends SkyeyeBusinessService queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(MybatisPlusUtil.toColumns(ShopTradeCart::getSelected), WhetherEnum.ENABLE_USING.getKey()) + .eq(MybatisPlusUtil.toColumns(ShopTradeCart::getCreateId), userId); + remove(queryWrapper); + } + @Override public void changeCount(InputObject inputObject, OutputObject outputObject) { Map params = inputObject.getParams(); From 0ddc86f819e167ef658c7248c6973d5e1b9fe993 Mon Sep 17 00:00:00 2001 From: wst <2450473462@qq.com> Date: Fri, 6 Dec 2024 16:13:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=A7=84=E6=A0=BC=E4=BF=A1=E6=81=AF=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E4=BB=8E=E5=95=86=E5=9F=8E=E6=8B=BF=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/skyeye/order/entity/OrderItem.java | 2 +- .../service/impl/OrderItemServiceImpl.java | 4 +-- .../order/service/impl/OrderServiceImpl.java | 26 ++++++++++--------- .../skyeye/store/entity/ShopTradeCart.java | 2 +- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/entity/OrderItem.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/entity/OrderItem.java index b1c31246..3971b49e 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/entity/OrderItem.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/entity/OrderItem.java @@ -74,7 +74,7 @@ public class OrderItem extends OperatorUserInfo { private Integer count; @TableField("comment_state") - @Property(value = "是否评价",enumClass = WhetherEnum.class) + @Property(value = "是否评价", enumClass = WhetherEnum.class) private Integer commentState; @TableField("price") diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderItemServiceImpl.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderItemServiceImpl.java index 85eaccdf..a0b39bd8 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderItemServiceImpl.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderItemServiceImpl.java @@ -118,7 +118,7 @@ public class OrderItemServiceImpl extends SkyeyeBusinessServiceImpl updateWrapper = new UpdateWrapper<>(); updateWrapper.eq(CommonConstants.ID, id) .set(MybatisPlusUtil.toColumns(OrderItem::getCommentState), WhetherEnum.ENABLE_USING.getKey()); @@ -135,7 +135,7 @@ public class OrderItemServiceImpl extends SkyeyeBusinessServiceImpl updateWrapper = new UpdateWrapper<>(); diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java index ee9e0cec..a7632259 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/impl/OrderServiceImpl.java @@ -13,8 +13,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; +import com.google.common.base.Joiner; import com.skyeye.annotation.service.SkyeyeService; import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl; +import com.skyeye.common.constans.CommonCharConstants; import com.skyeye.common.constans.CommonConstants; import com.skyeye.common.constans.CommonNumConstants; import com.skyeye.common.constans.QuartzConstants; @@ -31,8 +33,6 @@ import com.skyeye.coupon.enums.PromotionDiscountType; import com.skyeye.coupon.enums.PromotionMaterialScope; import com.skyeye.coupon.service.CouponUseMaterialService; import com.skyeye.coupon.service.CouponUseService; -import com.skyeye.erp.service.IMaterialNormsService; -import com.skyeye.erp.service.IMaterialService; import com.skyeye.eve.rest.quartz.SysQuartzMation; import com.skyeye.eve.service.IAreaService; import com.skyeye.eve.service.IQuartzService; @@ -47,6 +47,7 @@ import com.skyeye.order.enums.ShopOrderState; import com.skyeye.order.service.OrderItemService; import com.skyeye.order.service.OrderService; import com.skyeye.rest.pay.service.IPayService; +import com.skyeye.rest.shopmaterialnorms.sevice.IShopMaterialNormsService; import com.skyeye.store.entity.ShopAddress; import com.skyeye.store.service.ShopAddressService; import com.skyeye.store.service.ShopTradeCartService; @@ -79,10 +80,7 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl private IAreaService iAreaService; @Autowired - private IMaterialService iMaterialService; - - @Autowired - private IMaterialNormsService iMaterialNormsService; + private IShopMaterialNormsService iShopMaterialNormsService; @Autowired private CouponUseService couponUseService; @@ -134,17 +132,21 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl checkAndSetVariable(order); // 活动信息及积分操作方法 checkAndSetActive(order); - refreshCache(order.getId()); } private void checkAndSetItemCouponUse(Order order) {// 子单的优惠券操作 List orderItemList = order.getOrderItemList(); // 设置商品信息、商品规格信息和优惠券信息 - iMaterialNormsService.setDataMation(orderItemList, OrderItem::getNormsId); - iMaterialService.setDataMation(orderItemList, OrderItem::getMaterialId); + List normsIdList = orderItemList.stream().map(OrderItem::getNormsId).collect(Collectors.toList()); + List> normsListMap = iShopMaterialNormsService.queryShopMaterialByNormsIdList(Joiner.on(CommonCharConstants.COMMA_MARK).join(normsIdList)); + Map normsPriceMap = normsListMap.stream() + .collect(Collectors.toMap(map -> map.get("normsId").toString(), map -> map.get("salePrice").toString())); for (OrderItem orderItem : orderItemList) {// 计算每一个子单的总价 + if (!normsPriceMap.containsKey(orderItem.getNormsId())) { + throw new CustomException("商城不存在normsId: " + orderItem.getNormsId()); + } // 获取子单单价 元 -> 分 - String salePrice = CalculationUtil.multiply(orderItem.getNormsMation().get("salePrice").toString(), "100"); + String salePrice = CalculationUtil.multiply(normsPriceMap.get(orderItem.getNormsId()), "100"); // 设置子单总价 String price = CalculationUtil.multiply(String.valueOf(orderItem.getCount()), salePrice, CommonNumConstants.NUM_SIX); orderItem.setPrice(price); @@ -354,7 +356,7 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl ShopOrderState.COMPLETED.getKey(), // 已完成 ShopOrderState.UNEVALUATE.getKey(), // 待评价 ShopOrderState.EVALUATED.getKey()});// 已评价 - ShopOrderState.PARTIALLYDONE.getKey();//部分完成 + ShopOrderState.PARTIALLYDONE.getKey();//部分完成 break; case "4":// 已取消 stateList = Arrays.asList(new Integer[]{ShopOrderState.CANCELED.getKey()}); @@ -605,7 +607,7 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl orderItemService.UpdateOrderItemState(orderItemId); List orderItemList = orderItemService.queryOrderItemByParentId(orderId); boolean allTwo = orderItemList.stream().map(OrderItem::getOrderItemState) - .allMatch(orderItemState -> orderItemState == CommonNumConstants.NUM_TWO); + .allMatch(orderItemState -> orderItemState == CommonNumConstants.NUM_TWO); if (allTwo) { Integer partiallydoneKey = ShopOrderState.COMPLETED.getKey(); updateOrderState(orderId, partiallydoneKey); diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/store/entity/ShopTradeCart.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/store/entity/ShopTradeCart.java index 3f05f0f3..a2e04a3c 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/store/entity/ShopTradeCart.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/store/entity/ShopTradeCart.java @@ -65,6 +65,6 @@ public class ShopTradeCart extends OperatorUserInfo { private Integer count; @TableField("selected") - @ApiModelProperty(value = "是否选中", required = "required,num",enumClass = WhetherEnum.class) + @ApiModelProperty(value = "是否选中", required = "required,num", enumClass = WhetherEnum.class) private Integer selected; }