From 436453468b5a7c04c35256a0c140efd79269ddd4 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Sun, 24 Nov 2024 10:22:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=94=AF=E4=BB=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/skyeye/rest/pay/service/impl/IPayServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/skyeye-shop/shop-common/src/main/java/com/skyeye/rest/pay/service/impl/IPayServiceImpl.java b/skyeye-shop/shop-common/src/main/java/com/skyeye/rest/pay/service/impl/IPayServiceImpl.java index 5d40c120..523869c9 100644 --- a/skyeye-shop/shop-common/src/main/java/com/skyeye/rest/pay/service/impl/IPayServiceImpl.java +++ b/skyeye-shop/shop-common/src/main/java/com/skyeye/rest/pay/service/impl/IPayServiceImpl.java @@ -8,6 +8,7 @@ import cn.hutool.json.JSONUtil; import com.skyeye.base.rest.service.impl.IServiceImpl; import com.skyeye.common.client.ExecuteFeignClient; import com.skyeye.common.object.ResultEntity; +import com.skyeye.common.util.CalculationUtil; import com.skyeye.rest.pay.rest.IPayRest; import com.skyeye.rest.pay.service.IPayService; import org.springframework.beans.factory.annotation.Autowired; @@ -32,6 +33,10 @@ public class IPayServiceImpl extends IServiceImpl implements IPayService { @Override public ResultEntity payment(Map data, String channelCode, String returnUrl, String channelExtras, String notifyUrl) { + // 支付金额单位转换为分 + String payPrice = data.get("payPrice").toString(); + payPrice = CalculationUtil.multiply(payPrice, "100"); + data.put("payPrice", payPrice); Map params = new HashMap<>(); params.put("data", JSONUtil.toJsonStr(data)); params.put("channelCode", channelCode); From 862c78e0694ea180df0ec8e426e2b4cf8772b342 Mon Sep 17 00:00:00 2001 From: wst <2450473462@qq.com> Date: Sun, 24 Nov 2024 10:42:52 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E5=AD=90=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=BB=E8=BE=91=E7=A7=BB=E8=87=B3OrderItem?= =?UTF-8?q?ServiceImpl=EF=BC=8C=E9=97=A8=E5=BA=97id=E4=B8=8D=E4=BD=9C?= =?UTF-8?q?=E4=B8=BA=E5=89=8D=E7=AB=AF=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/skyeye/order/entity/OrderItem.java | 2 +- .../order/service/OrderItemService.java | 3 +++ .../service/impl/OrderItemServiceImpl.java | 23 +++++++++++++++++++ .../order/service/impl/OrderServiceImpl.java | 10 ++------ 4 files changed, 29 insertions(+), 9 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 ad0b0ec8..0e61b912 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 @@ -26,7 +26,7 @@ public class OrderItem extends OperatorUserInfo { private String parentId; @TableField("store_id") - @ApiModelProperty(value = "门店id") + @Property(value = "门店id") private String storeId; @TableField(exist = false) diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderItemService.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderItemService.java index 4221ffb0..f84de134 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderItemService.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderItemService.java @@ -2,6 +2,7 @@ package com.skyeye.order.service; import com.skyeye.base.business.service.SkyeyeBusinessService; import com.skyeye.common.enumeration.WhetherEnum; +import com.skyeye.order.entity.Order; import com.skyeye.order.entity.OrderItem; import org.aspectj.weaver.ast.Or; @@ -18,4 +19,6 @@ public interface OrderItemService extends SkyeyeBusinessService { List queryListByStateAndOrderId(String orderId, Integer state); Map> queryListByParentId(List idList); + + void setValueAndCreateEntity(Order order, String userId); } 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 9df2103a..144078f3 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 @@ -5,10 +5,12 @@ import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.skyeye.annotation.service.SkyeyeService; import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl; +import com.skyeye.common.enumeration.WhetherEnum; import com.skyeye.common.util.mybatisplus.MybatisPlusUtil; import com.skyeye.erp.service.IMaterialNormsService; import com.skyeye.erp.service.IMaterialService; import com.skyeye.order.dao.OrderItemDao; +import com.skyeye.order.entity.Order; import com.skyeye.order.entity.OrderItem; import com.skyeye.order.service.OrderItemService; import com.skyeye.rest.shopmaterialnorms.sevice.IShopMaterialNormsService; @@ -77,4 +79,25 @@ public class OrderItemServiceImpl extends SkyeyeBusinessServiceImpl> result = mapList.stream().collect(Collectors.groupingBy(OrderItem::getParentId)); return result; } + + @Override + public void setValueAndCreateEntity(Order order, String userId) { + List materialStoreIds = order.getOrderItemList().stream().map(OrderItem::getMaterialStoreId).distinct().collect(Collectors.toList()); + // shopMaterial -> shopMaterialStore -> storeId + List> materialByIds = iShopMaterialNormsService.queryShopMaterialByIds(materialStoreIds);// erp-shop-material + Map materialStoreMap = materialByIds.stream() + .distinct().collect(Collectors.toMap(map -> { + Map shopMaterialStore = JSONUtil.toBean(map.get("shopMaterialStore").toString(), null); + return shopMaterialStore.get("id").toString(); + }, map -> { + Map shopMaterialStore = JSONUtil.toBean(map.get("shopMaterialStore").toString(), null); + return shopMaterialStore.get("storeId").toString(); + })); + for (OrderItem orderItem : order.getOrderItemList()) { + orderItem.setCommentState(WhetherEnum.DISABLE_USING.getKey()); + orderItem.setParentId(order.getId()); + orderItem.setStoreId(materialStoreMap.containsKey(orderItem.getMaterialStoreId()) ? materialStoreMap.get(orderItem.getMaterialStoreId()) : ""); + } + super.createEntity(order.getOrderItemList(), userId); + } } \ No newline at end of file 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 f28743eb..8f4cba03 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 @@ -9,13 +9,11 @@ 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.protobuf.ServiceException; import com.skyeye.annotation.service.SkyeyeService; import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl; import com.skyeye.common.constans.CommonConstants; import com.skyeye.common.constans.CommonNumConstants; import com.skyeye.common.entity.search.CommonPageInfo; -import com.skyeye.common.enumeration.WhetherEnum; import com.skyeye.common.object.InputObject; import com.skyeye.common.object.OutputObject; import com.skyeye.common.util.CalculationUtil; @@ -242,11 +240,7 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl @Override public void createPostpose(Order order, String userId) { - for (OrderItem orderItem : order.getOrderItemList()) { - orderItem.setCommentState(WhetherEnum.DISABLE_USING.getKey()); - orderItem.setParentId(order.getId()); - } - orderItemService.createEntity(order.getOrderItemList(), userId); + orderItemService.setValueAndCreateEntity(order, userId); } @Override @@ -378,7 +372,7 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl public void changeOrderAdjustPrice(InputObject inputObject, OutputObject outputObject) { Map params = inputObject.getParams(); int adjustPrice = Integer.parseInt(params.get("adjustPrice").toString()); - if( adjustPrice< CommonNumConstants.NUM_ZERO){ + if (adjustPrice < CommonNumConstants.NUM_ZERO) { throw new CustomException("所调价格不可为负数"); } UpdateWrapper updateWrapper = new UpdateWrapper<>(); From a9e1ba17f174e993942ecfb84a3fcbfd0c19a05d Mon Sep 17 00:00:00 2001 From: wst <2450473462@qq.com> Date: Sun, 24 Nov 2024 10:43:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E5=8C=85=E5=92=8C=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/skyeye/order/service/OrderItemService.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderItemService.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderItemService.java index f84de134..c14244aa 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderItemService.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/order/service/OrderItemService.java @@ -1,10 +1,8 @@ package com.skyeye.order.service; import com.skyeye.base.business.service.SkyeyeBusinessService; -import com.skyeye.common.enumeration.WhetherEnum; import com.skyeye.order.entity.Order; import com.skyeye.order.entity.OrderItem; -import org.aspectj.weaver.ast.Or; import java.util.List; import java.util.Map; @@ -14,8 +12,6 @@ public interface OrderItemService extends SkyeyeBusinessService { void deleteByPerentIds(List ids); -// List selectByParentId(String id); - List queryListByStateAndOrderId(String orderId, Integer state); Map> queryListByParentId(List idList);